summaryrefslogtreecommitdiff
path: root/scripts/status_script.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/status_script.py')
-rwxr-xr-xscripts/status_script.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/scripts/status_script.py b/scripts/status_script.py
index a5595ac..1b30d01 100755
--- a/scripts/status_script.py
+++ b/scripts/status_script.py
@@ -64,26 +64,17 @@ def tweet(status, last_change):
else:
print "Message too long: " + tweet
-def update_css(colors):
+def update_css(statusimage):
css = '''
-span.sublabopen {
- color: %s;
-}
-
-span.sublabclosed {
- color: %s;
-}
-
#statusimage {
background: url(../img/%s) ;
- height: 100px;
- width: 100px;
- position: absolute;
- right: 20px;
+ height: 40px;
+ width: 40px;
+ margin: 5px;
}
-''' % colors
+''' % statusimage
path = os.path.realpath(os.path.dirname(__file__))
path = os.path.join(path, '..', 'public', 'css', 'sublab.status.css')
@@ -120,14 +111,14 @@ if __name__ == '__main__':
# check if status changed, if yes, update css and tweet it
if s.door_status() != old_status:
if s.door_status() == 'open':
- update_css(('#0f0', '#222', 'status-open.png'))
+ update_css('status-open.png')
save_statusfile(STATUSFILE, s.door_status())
tweet('open', last_change)
elif s.door_status() == 'closed':
save_statusfile(STATUSFILE, s.door_status())
- update_css(('#222', '#f00', 'status-closed.png'))
+ update_css('status-closed.png')
tweet('closed', last_change)
else:
save_statusfile(STATUSFILE, s.door_status())
- update_css(('#222', '#222', 'status-unknown.png'))
+ update_css('status-unknown.png')
tweet('unknown', last_change)