From 60bdcb7aab6e4a8586d3243676463c0729500c81 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 4 Jul 2016 21:14:29 +0200 Subject: [PATCH] add credit and render-date/time to template-footer --- tsstats/template.html | 1 + tsstats/template.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tsstats/template.html b/tsstats/template.html index d78b6fc..0c1a056 100644 --- a/tsstats/template.html +++ b/tsstats/template.html @@ -32,6 +32,7 @@ {% endif %} {% endfor %} +Generated by TeamspeakStats at {{ creation_time|frmttime }} diff --git a/tsstats/template.py b/tsstats/template.py index 1384fa3..67277c3 100644 --- a/tsstats/template.py +++ b/tsstats/template.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import logging +from datetime import datetime from os.path import dirname from jinja2 import ChoiceLoader, Environment, FileSystemLoader, PackageLoader @@ -56,4 +57,5 @@ def render_template(clients, output, title='TeamspeakStats'): template = template_env.get_template('template.html') with open(output, 'w') as f: f.write(template.render(title=title, objs=objs, - debug=logger.level <= logging.DEBUG)) + debug=logger.level <= logging.DEBUG, + creation_time=datetime.now()))