diff --git a/setup.py b/setup.py index af33de2..985edb7 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='tsstats', - version='0.11.0', + version='0.11.1', author='Thor77', author_email='thor77@thor77.org', description='A simple Teamspeak stats-generator', diff --git a/tsstats/template.py b/tsstats/template.py index 9700dfa..2c42ccb 100644 --- a/tsstats/template.py +++ b/tsstats/template.py @@ -57,10 +57,14 @@ def render_template(clients, output, title='TeamspeakStats', def frmttime(timestamp): if not timestamp: return '' - return timestamp.strftime(datetime_fmt) + formatted = timestamp.strftime(datetime_fmt) + logger.debug('Formatting timestamp %s -> %s', timestamp, formatted) + return formatted template_env.filters['frmttime'] = frmttime template = template_env.get_template(template_path) + logger.debug('Rendering template %s', template) with open(output, 'w') as f: f.write(template.render(title=title, objs=objs, debug=logger.level <= logging.DEBUG, creation_time=datetime.now())) + logger.debug('Wrote rendered template to %s', output)