Beispiel #1
0
def configure(  # nosec: hardcoded_password_default
    username: str = "",
    password: str = "",
    config_file: str = "",
    host: str = "",
) -> str:
    """Configure internetarchive with your Archive.org credentials.

    :param username: The email address associated with your Archive.org account.

    :param password: Your Archive.org password.

    :returns: The config file path.

    Usage:
        >>> from internetarchive import configure
        >>> configure('*****@*****.**', 'password')
    """
    auth_config = config_module.get_auth_config(
        username or input("Email address: "),
        password or getpass("Password: "),
        host,
    )
    config_file_path = config_module.write_config_file(auth_config,
                                                       config_file)
    return config_file_path
Beispiel #2
0
def configure(username=None, password=None):
    """Configure internetarchive with your Archive.org credentials.

    :type username: str
    :param username: The email address associated with your Archive.org account.

    :type password: str
    :param password: Your Archive.org password.
    """
    username = input('Email address: ') if not username else username
    password = getpass('Password: '******'\nConfig saved to: {0}'.format(config_file_path))
Beispiel #3
0
def configure(username=None, password=None, config_file=None):
    """Configure internetarchive with your Archive.org credentials.

    :type username: str
    :param username: The email address associated with your Archive.org account.

    :type password: str
    :param password: Your Archive.org password.

    Usage:
        >>> from internetarchive import configure
        >>> configure('*****@*****.**', 'password')
    """
    username = input('Email address: ') if not username else username
    password = getpass('Password: ') if not password else password
    config_file_path = config_module.write_config_file(username, password, config_file)
    return config_file_path
Beispiel #4
0
def configure(username=None, password=None, config_file=None):
    """Configure internetarchive with your Archive.org credentials.

    :type username: str
    :param username: The email address associated with your Archive.org account.

    :type password: str
    :param password: Your Archive.org password.

    Usage:
        >>> from internetarchive import configure
        >>> configure('*****@*****.**', 'password')
    """
    username = input('Email address: ') if not username else username
    password = getpass('Password: ') if not password else password
    config_file_path = config_module.write_config_file(username, password, config_file)
    return config_file_path