From 1983cc3b1ea8c862af6b9241e2055eed2c0d6ea5 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 19 Apr 2023 14:59:45 +0200 Subject: [PATCH] [new] add logo on html webpage --- parameters.yaml | 3 +++ survBot.py | 2 +- write_utils.py | 12 +++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/parameters.yaml b/parameters.yaml index c59f05d..68b9b9d 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -128,6 +128,9 @@ add_global_links: - {"text": "show recent events on map", "URL": "https://fdsnws.geophysik.ruhr-uni-bochum.de/map/?lat=39.5&lon=21&zoom=7&baselayer=mapnik"} +# html logo at page bottom +html_logo: "figures/Logo_RUB_BLAU_rgb.png" + # E-mail notifications EMAIL: mailserver: "localhost" diff --git a/survBot.py b/survBot.py index 55c5083..261965a 100755 --- a/survBot.py +++ b/survBot.py @@ -508,7 +508,7 @@ class SurveillanceBot(object): outfile.write(get_html_text(link_str)) outfile.write(get_html_text(self.status_message)) - outfile.write(html_footer()) + outfile.write(html_footer(footer_logo=self.parameters.get('html_logo'))) except Exception as e: print(f'Could not write HTML table to {fnout}:') diff --git a/write_utils.py b/write_utils.py index dd35dd5..58a6747 100644 --- a/write_utils.py +++ b/write_utils.py @@ -47,9 +47,15 @@ def finish_html_table(): return '\n' -def html_footer(): - footer = ['', - '\n'] +def html_footer(footer_logo=None): + footer = [''] + if footer_logo: + logo_items = [f''] + footer += logo_items + footer.append('\n') + footer = _convert_to_textstring(footer) return footer