Enable Ctrl+C in MacOS UI mode.

Sun, 28 Jan 2018 12:41:50 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 28 Jan 2018 12:41:50 +0000
changeset 82
4e7678dd7b42
parent 81
7bcd715f19e3
child 83
1643b1120cc2

Enable Ctrl+C in MacOS UI mode.
TODO: proper exit handler, which seems to require
ditching/forking/extending rumps to extend the NSApp class

borgend.py file | annotate | diff | comparison | revisions
--- a/borgend.py	Sun Jan 28 12:00:18 2018 +0000
+++ b/borgend.py	Sun Jan 28 12:41:50 2018 +0000
@@ -83,6 +83,11 @@
         # Wait for scheduler to finish
         scheduler.join()
     else:
+        # This is needed for Ctrl+C to work.
+        # TODO: proper exit handler, which seems to require
+        # ditching/forking/extending rumps to extend the NSApp class
+        from PyObjCTools.AppHelper import installMachInterrupt
+        installMachInterrupt()
         # Start UI, and let it handle exit control
         from borgend.ui import BorgendTray
         tray=BorgendTray(backups);
@@ -94,6 +99,8 @@
     logger.exception("Exception fell through: exiting")
 
 finally:
+    logger.debug("Exiting")
+
     for b in backups:
         b.terminate()
 

mercurial