Exemplo n.º 1
0
 def init_keyring(self):
     return OS_X.Keyring()
Exemplo n.º 2
0
        try:
            keyring_entry = RepoPassword.get(url=repo_url)
            return keyring_entry.password
        except Exception:
            return None

    def delete_password(self, service, repo_url):
        pass


"""Select keyring/Workaround for pyinstaller+keyring issue."""
if sys.platform == "darwin":
    from keyring.backends import OS_X

    keyring.set_keyring(OS_X.Keyring())
elif sys.platform == "win32":
    from keyring.backends import Windows

    keyring.set_keyring(Windows.WinVaultKeyring())
elif sys.platform == "linux":
    from keyring.backends import SecretService

    try:
        SecretService.Keyring.priority()  # Test if keyring works.
        keyring.set_keyring(SecretService.Keyring())
    except Exception:
        keyring.set_keyring(RestaticKeyring())
else:  # Fall back to saving password to database.
    keyring.set_keyring(RestaticKeyring())