@classmethod
def from_repository_config(cls, repo_config, username=None, password=None):
    """Instantiate the uploader using repository configuration dictionary.

        Examples::

            >>> repo_config = {
            ...     'repository': 'http://localhost:8000',
            ...     'username': 'foo',
            ...     'password': 'bar',
            ... }
            >>> uploader = PackageUploader.from_repository_config(repo_config)
            >>> uploader.host, uploader.username, uploader.password
            'http://localhost:8000', 'foo', 'bar'
            >>> uploader = PackageUploader.from_repository_config(
            ...     repo_config, username='bar')
            >>> uploader.host, uploader.username, uploader.password
            'http://localhost:8000', 'bar', 'bar'

        Return a new instance of :class:`PackageUploader`.

        :param repo_config:
            A dictionary with the repository configuration, must contain
            three keys:

            * repository,
            * username
            * password

        :param username:
            Optional username to override the one from the **repo_cofig**.
        :param password:
            Optional password to override the one from the **repo_cofig**.

        """
    host = repo_config['repository']
    username = username or repo_config['username']
    password = password or repo_config['password']
    return cls(host, username, password)
