'Initialise an instance.
:param url: The URL of the index. If not specified, the URL for PyPI is
used.'

def __init__(self, url=None):

    self.url = (url or DEFAULT_INDEX)
    self.read_configuration()
    (scheme, netloc, path, params, query, frag) = urlparse(self.url)
    if (params or query or frag or (scheme not in ('http', 'https'))):
        raise DistlibException(('invalid    repository:    %s' % self.url))
    self.password_handler = None
    self.ssl_verifier = None
    self.gpg = None
    self.gpg_home = None
    self.rpc_proxy = None
    with open(os.devnull, 'w') as sink:
        for s in ('gpg2', 'gpg'):
            try:
                rc = subprocess.check_call([s, '--version'], stdout=sink, stderr=sink)
                if (rc == 0):
                    self.gpg = s
                    break
            except OSError:
                pass
