ui.py

changeset 16
d0ffae5550ef
parent 15
aaf1a281a3fe
child 18
6d8ac70c5fb9
--- a/ui.py	Sat Jan 20 21:52:16 2018 +0000
+++ b/ui.py	Sat Jan 20 23:00:43 2018 +0000
@@ -10,17 +10,18 @@
 
 INACTIVE=0
 ACTIVE=1
-ERRORS=2
+OFFLINE=2
+ERRORS=3
 
-traynames={INACTIVE: 'B.', ACTIVE: 'B!', ERRORS: 'B?'}
+traynames={
+    INACTIVE: 'B.',
+    ACTIVE: 'B!',
+    OFFLINE: 'B⦙',
+    ERRORS: 'B?'
+}
 
 def combine_state(state1, state2):
-    if state1==ERRORS or state2==ERRORS:
-        return ERRORS
-    elif state1==ACTIVE or state2==ACTIVE:
-        return ACTIVE
-    else:
-        return INACTIVE
+    return max(state1, state2)
 
 def make_title(status):
     state=INACTIVE

mercurial