diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2023-02-13 19:43:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2023-02-13 19:43:51 +0000 |
commit | f73f2356820468344757dbb9d7f3ec73ece7bf66 (patch) | |
tree | cc4d1f8559ab8d0e73f4efed80c1f5c866501a12 /web/log.py | |
parent | Reworking container version command in python. (diff) | |
download | compute-tools-next+web.tar.xz compute-tools-next+web.zip |
Updating.next+web
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | web/log.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/web/log.py b/web/log.py new file mode 100755 index 0000000..7efb624 --- /dev/null +++ b/web/log.py @@ -0,0 +1,27 @@ +#!/usr/bin/python3.10 + +import platform + +def print_html(htmlfile, host_name): + with open(htmlfile, 'r') as f: + html = f.read() + + print(html.format(**locals())) + +def get_host_name(): + host_name = platform.node() + + return host_name + +def main(): + host_name = get_host_name() + + print('Content-Type: text/html\n') + print_html('html/header.html.in', host_name) + print_html('html/log.html.in', host_name) + print_html('html/footer.html', host_name) + + exit(0) + +if __name__ == '__main__': + main() |