ui.py

changeset 79
b075b3db3044
parent 78
83b43987e61e
equal deleted inserted replaced
78:83b43987e61e 79:b075b3db3044
3 # 3 #
4 4
5 import rumps 5 import rumps
6 import time 6 import time
7 import datetime 7 import datetime
8 import logging 8 import objc
9 import borgend 9 from threading import Lock, Timer
10
11 import loggers
10 import backup 12 import backup
11 import dreamtime 13 import dreamtime
12 from threading import Lock, Timer 14 import branding
13 from config import settings 15 from config import settings
14 import objc 16
15 17 logger=loggers.get(__name__)
16 logger=borgend.logger.getChild(__name__)
17 18
18 traynames_ok={ 19 traynames_ok={
19 backup.State.INACTIVE: 'B.', 20 backup.State.INACTIVE: 'B.',
20 backup.State.SCHEDULED: 'B.', 21 backup.State.SCHEDULED: 'B.',
21 backup.State.QUEUED: 'B:', 22 backup.State.QUEUED: 'B:',
254 msgid=errorlog['msgid'] 255 msgid=errorlog['msgid']
255 256
256 logger.debug("Opening notification for error %s '%s'", 257 logger.debug("Opening notification for error %s '%s'",
257 msgid, errorlog['message']) 258 msgid, errorlog['message'])
258 259
259 notification_workaround(borgend.appname_stylised, 260 notification_workaround(branding.appname_stylised,
260 msgid, errorlog['message']) 261 msgid, errorlog['message'])
261 262
262 def quit(self): 263 def quit(self):
263 logging.shutdown()
264 rumps.quit_application() 264 rumps.quit_application()
265 265
266 def __menu_select_backup(self, sender, b): 266 def __menu_select_backup(self, sender, b):
267 #sender.state=not sender.state 267 #sender.state=not sender.state
268 logger.debug("Manually backup '%s'", b.name) 268 logger.debug("Manually backup '%s'", b.name)
269 try: 269 try:
270 b.create() 270 b.create()
271 except Exception as err: 271 except Exception as err:
272 logger.exception("Failure to initialise backup") 272 logger.exception("Failure to initialise backup")
273 notification_workaround(borgend.appname_stylised, 273 notification_workaround(branding.appname_stylised,
274 err.__class__.__name__, str(err)) 274 err.__class__.__name__, str(err))
275 275
276 # 276 #
277 # Log window 277 # Log window
278 # 278 #

mercurial