71 for i in range(len(backupconfigs)): |
71 for i in range(len(backupconfigs)): |
72 logger.info('Setting up backup set %d' % i) |
72 logger.info('Setting up backup set %d' % i) |
73 b=Backup(i, backupconfigs[i], scheduler) |
73 b=Backup(i, backupconfigs[i], scheduler) |
74 backups.append(b) |
74 backups.append(b) |
75 |
75 |
76 for r in repos: |
|
77 r.start() |
|
78 |
|
79 for b in backups: |
|
80 b.start() |
|
81 |
|
82 if args.notray or platform.system()!='Darwin': |
76 if args.notray or platform.system()!='Darwin': |
83 # Wait for scheduler to finish |
77 # Wait for scheduler to finish |
84 scheduler.join() |
78 run=scheduler.join |
85 else: |
79 else: |
86 # This is needed for Ctrl+C to work. |
80 # This is needed for Ctrl+C to work. |
87 # TODO: proper exit handler, which seems to require |
81 # TODO: proper exit handler, which seems to require |
88 # ditching/forking/extending rumps to extend the NSApp class |
82 # ditching/forking/extending rumps to extend the NSApp class |
89 from PyObjCTools.AppHelper import installMachInterrupt |
83 from PyObjCTools.AppHelper import installMachInterrupt |
90 installMachInterrupt() |
84 installMachInterrupt() |
91 # Start UI, and let it handle exit control |
85 # Start UI, and let it handle exit control |
92 from borgend.ui import BorgendTray |
86 from borgend.ui import BorgendTray |
93 tray=BorgendTray(backups); |
87 tray=BorgendTray(backups); |
94 tray.run() |
88 run=tray.run |
|
89 |
|
90 for r in repos: |
|
91 r.start() |
|
92 |
|
93 for b in backups: |
|
94 b.start() |
|
95 |
|
96 run() |
95 |
97 |
96 except Exception as err: |
98 except Exception as err: |
97 # TODO: Should write errors here to stderr; |
99 # TODO: Should write errors here to stderr; |
98 # perhaps add an extra stderr logger for error level messages |
100 # perhaps add an extra stderr logger for error level messages |
99 logger.exception("Exception fell through: exiting") |
101 logger.exception("Exception fell through: exiting") |