diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -241,6 +241,7 @@ writeLog() # HTML Processing to generate the website. code = '\r\n' +is_offline_class = '' for status in statusList: # Prepare and calculate the time since the server is online / offline obj = getLogEntry(status) @@ -257,7 +258,8 @@ for status in statusList: timeString += str(hours) + ' hours ' if minutes > 0: timeString += str(minutes) + ' minutes' - + if status.status == 'Offline': + is_offline_class = 'pulse' code += ('<div class="content_item"><div class="content_item_part"><div class="content_item_part_title">' + status.name + '</div><div class="content_item_part_subtitle">' + status.host + '</div></div><div class="content_item_part ' @@ -287,8 +289,9 @@ for entry in reversed(logEntries[cut_amount:]): now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') html = open('template.html') html2 = open('status.html', 'w') +pulse = '' for line in html: - html2.write(line.replace('%CONTENT%', code).replace('%LOG%', log).replace('%NOW%', now)) + html2.write(line.replace('%CONTENT%', code).replace('%LOG%', log).replace('%NOW%', now).replace('%PULSE%', is_offline_class)) html.close() html2.close() |