How to use the pyicloud.exceptions.NoStoredPasswordAvailable function in pyicloud

To help you get started, we’ve selected a few pyicloud 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 picklepete / pyicloud / pyicloud / utils.py View on Github external
def get_password_from_keyring(username):
    result = keyring.get_password(
        KEYRING_SYSTEM,
        username
    )
    if result is None:
        raise NoStoredPasswordAvailable(
            "No pyicloud password for {username} could be found "
            "in the system keychain.  Use the `--store-in-keyring` "
            "command-line option for storing a password for this "
            "username.".format(
                username=username,
            )
        )

    return result
github picklepete / pyicloud / pyicloud / utils.py View on Github external
def password_exists_in_keyring(username):
    try:
        get_password_from_keyring(username)
    except NoStoredPasswordAvailable:
        return False

    return True