Horrible py2app hack

Tue, 18 Sep 2018 19:09:16 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 18 Sep 2018 19:09:16 -0500
changeset 121
1279af7591f0
parent 120
109eaddc16e1
child 122
8d2881338a4a

Horrible py2app hack

borgend/repository.py file | annotate | diff | comparison | revisions
--- a/borgend/repository.py	Tue Sep 18 18:58:19 2018 -0500
+++ b/borgend/repository.py	Tue Sep 18 19:09:16 2018 -0500
@@ -4,8 +4,18 @@
 # Repository abstraction for queuing.
 #
 
+import os
+env=os.environ.copy()
+if '_PY2APP_LAUNCHED_' in env:
+    # Horrible hack to make keyring work the shit knownas py2app.
+    from keyring.backends.OS_X import Keyring
+    import keyring
+    keyring.set_keyring(Keyring())
+else:
+    # Normal import
+    import keyring
+
 import weakref
-import keyring
 import logging
 
 from . import config

mercurial