summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian <florianraemisch@web.de>2012-09-18 20:30:44 +0200
committerFlorian <florianraemisch@web.de>2012-09-18 20:30:44 +0200
commit4adecf0fa7ee7b96a3dda7379244e9a920a5b528 (patch)
treedaa3fc144e090b78e152fea7cf2263ffdda0caef /scripts
parent2725059ce685dd69c5e8e8ea783cf09f9901b356 (diff)
show status image in website header
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/status_script.py17
1 files changed, 13 insertions, 4 deletions
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__))