1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Minor: Add hidden keyring imports for macOS

This commit is contained in:
Manu 2021-03-03 21:50:14 +08:00
parent 7dc6f83b92
commit 2b009c517f
2 changed files with 10 additions and 2 deletions

View file

@ -28,6 +28,9 @@ a = Analysis([os.path.join(SRC_DIR, '__main__.py')],
hiddenimports=[
'vorta.views.dark.collection_rc',
'vorta.views.light.collection_rc',
'vorta.keyring.darwin',
'vorta.keyring.kwallet',
'vorta.keyring.secretstorage',
'pkg_resources.py2_warn',
],
hookspath=[],

View file

@ -1,6 +1,9 @@
import importlib
import logging
from vorta.i18n import trans_late
logger = logging.getLogger(__name__)
class VortaKeyring:
all_keyrings = [
@ -20,13 +23,15 @@ def get_keyring(cls):
try:
keyring = getattr(importlib.import_module(_module, package='vorta.keyring'), _class)
available_keyrings.append((keyring, keyring.get_priority()))
except Exception:
except Exception as e:
logger.debug(e)
continue
for keyring, _ in sorted(available_keyrings, key=lambda k: k[1], reverse=True):
try:
return keyring()
except Exception:
except Exception as e:
logger.debug(e)
continue
def get_backend_warning(self):