borgend.py

changeset 85
56a000d15965
parent 82
4e7678dd7b42
child 87
a214d475aa28
--- a/borgend.py	Sun Jan 28 14:56:13 2018 +0000
+++ b/borgend.py	Sun Jan 28 17:34:06 2018 +0000
@@ -73,15 +73,9 @@
         b=Backup(i, backupconfigs[i], scheduler)
         backups.append(b)
 
-    for r in repos:
-        r.start()
-
-    for b in backups:
-        b.start()
-
     if args.notray or platform.system()!='Darwin':
         # Wait for scheduler to finish
-        scheduler.join()
+        run=scheduler.join
     else:
         # This is needed for Ctrl+C to work.
         # TODO: proper exit handler, which seems to require
@@ -91,7 +85,15 @@
         # Start UI, and let it handle exit control
         from borgend.ui import BorgendTray
         tray=BorgendTray(backups);
-        tray.run()
+        run=tray.run
+
+    for r in repos:
+        r.start()
+
+    for b in backups:
+        b.start()
+
+    run()
 
 except Exception as err:
     # TODO: Should write errors here to stderr;

mercurial