Oops, removed stray reset of menu entry info

Tue, 06 Feb 2018 08:30:20 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 06 Feb 2018 08:30:20 +0000
changeset 110
a79409c72565
parent 109
246190bfd501
child 111
c3bc27cf5ece

Oops, removed stray reset of menu entry info

borgend/ui.py file | annotate | diff | comparison | revisions
--- a/borgend/ui.py	Mon Feb 05 18:34:08 2018 +0000
+++ b/borgend/ui.py	Tue Feb 06 08:30:20 2018 +0000
@@ -9,6 +9,7 @@
 import datetime
 import logging
 import objc
+import math
 from threading import Lock, Timer
 
 from . import backup
@@ -118,9 +119,8 @@
         when=status.when()
         now=time.time()
 
-        if when<now:
-            whenstr='overdue'
-            info=''
+        if when==math.inf:
+            whenstr='--'
         else:
             tnow=datetime.datetime.fromtimestamp(now)
             twhen=datetime.datetime.fromtimestamp(when)
@@ -128,7 +128,9 @@
             tendtomorrow=tendtoday+datetime.timedelta(days=1)
             diff=datetime.timedelta(seconds=when-now)
 
-            if twhen>tendtomorrow:
+            if twhen<tnow:
+                whenstr='overdue'
+            elif twhen>tendtomorrow:
                 # Display date if scheduled event is after tomorrow
                 whenday=datetime.date.fromtimestamp(when)
                 whenstr='on %s' % twhen.date().isoformat()
@@ -146,13 +148,13 @@
                     twhen=time.localtime(when+30)
                 whenstr='at %02d:%02d' % (twhen.tm_hour, twhen.tm_min)
 
-            this_info=''
-            if 'reason' in status.detail:
-                this_info=status.detail['reason'] + ' '
+        this_info=''
+        if 'reason' in status.detail:
+            this_info=status.detail['reason'] + ' '
 
-            when_how_sched= "%s%s %s" % (this_info, status.type, whenstr)
+        when_how_sched= "%s%s %s" % (this_info, status.type, whenstr)
 
-            info=add_info(info, when_how_sched)
+        info=add_info(info, when_how_sched)
 
     elif status.state==backup.State.QUEUED:
         info=add_info(info, "queued %s" % status.type)

mercurial