How to use the keyring.errors.ExceptionRaisedContext function in keyring

To help you get started, we’ve selected a few keyring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / keyczar.py View on Github external
def has_keyczar():
    with errors.ExceptionRaisedContext() as exc:
        keyczar.__name__
    return not bool(exc)
github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / Google.py View on Github external
def _has_gdata(cls):
        with ExceptionRaisedContext() as exc:
            gdata.__name__
        return not bool(exc)
github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / pyfs.py View on Github external
def has_pyfs():
    """
    Does this environment have pyfs installed?
    Should return False even when Mercurial's Demand Import allowed import of
    fs.*.
    """
    with errors.ExceptionRaisedContext() as exc:
        fs.__name__
    return not bool(exc)
github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / Windows.py View on Github external
def has_wincrypto():
    """
    Does this environment have wincrypto?
    Should return False even when Mercurial's Demand Import allowed import of
    _win_crypto, so accesses an attribute of the module.
    """
    with ExceptionRaisedContext() as exc:
        _win_crypto.__name__
    return not bool(exc)
github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / Windows.py View on Github external
def has_pywin32():
    """
    Does this environment have pywin32?
    Should return False even when Mercurial's Demand Import allowed import of
    win32cred.
    """
    with ExceptionRaisedContext() as exc:
        win32cred.__name__
    return not bool(exc)
github andrey-yantsen / plexiglas / plexiglas / plugin.py View on Github external
def viable(cls):
        with ExceptionRaisedContext() as exc:
            cls.priority
        return not bool(exc)
github nficano / alexa-find-my-iphone / src / site-packages / keyrings / alt / kwallet.py View on Github external
def priority(cls):
        with ExceptionRaisedContext() as exc:
            KWallet.__name__
        if exc:
            raise RuntimeError("KDE libraries not available")
        if "DISPLAY" not in os.environ:
            raise RuntimeError("cannot connect to X server")
        # Infer if KDE environment is active based on environment vars.
        # TODO: Does PyKDE provide a better indicator?
        kde_session_keys = (
            'KDE_SESSION_ID', # most environments
            'KDE_FULL_SESSION', # openSUSE
        )
        if not set(os.environ).intersection(kde_session_keys):
            return 0
        return 5