Added offline symbol B⦙ (no offline detection yet)

Sat, 20 Jan 2018 23:00:43 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 20 Jan 2018 23:00:43 +0000
changeset 16
d0ffae5550ef
parent 15
aaf1a281a3fe
child 17
5f6aa8830cea

Added offline symbol B⦙ (no offline detection yet)

backup.py file | annotate | diff | comparison | revisions
ui.py file | annotate | diff | comparison | revisions
--- a/backup.py	Sat Jan 20 21:52:16 2018 +0000
+++ b/backup.py	Sat Jan 20 23:00:43 2018 +0000
@@ -160,7 +160,7 @@
 
             if errors_this_message:
                 with self.lock:
-                    self.current_operation.errors=True
+                    self.current_operation['errors']=True
                     status, callback=self.__status_unlocked()
 
             if callback:
--- 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