From dafa62e4e35c2d432fda97d7561e66f5522ccccd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Feb 2019 15:47:41 +0100 Subject: Write update timestamp to html output --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.py') diff --git a/main.py b/main.py index 61c5159..ea13990 100755 --- a/main.py +++ b/main.py @@ -261,10 +261,11 @@ for entry in reversed(logEntries[cut_amount:]): + entry.msg + '') # Replace the %CONTENT% in the template with the actual html code. +now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") html = open('template.html') html2 = open('status.html', 'w') for line in html: - html2.write(line.replace('%CONTENT%', code).replace('%LOG%', log)) + html2.write(line.replace('%CONTENT%', code).replace('%LOG%', log).replace('%NOW%', now)) html.close() html2.close() -- cgit v1.2.3-55-g7522