From 4adecf0fa7ee7b96a3dda7379244e9a920a5b528 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 18 Sep 2012 20:30:44 +0200 Subject: show status image in website header --- scripts/status_script.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/status_script.py b/scripts/status_script.py index 1c229e0..8881735 100755 --- a/scripts/status_script.py +++ b/scripts/status_script.py @@ -31,21 +31,30 @@ class SublabStatus(object): if __name__ == '__main__': s = SublabStatus() if s.door_status() == 'open': - colors = ('#0f0', '#222') + colors = ('#0f0', '#222', 'status-open.png') elif s.door_status() == 'closed': - colors = ('#222', '#f00') + colors = ('#222', '#f00', 'status-closed.png') else: - colors = ('#222', '#222') + colors = ('#222', '#222', 'status-unknown.png') css = ''' span.sublabopen { color: %s; } - span.sublabclosed { color: %s; } + +#statusimage { + background: url(../img/%s) ; + height: 100px; + width: 100px; + position: absolute; + right: 20px; +} + + ''' % colors path = os.path.realpath(os.path.dirname(__file__)) -- cgit v1.2.1