You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
487 B

  1. from pip._vendor.six.moves.urllib import parse as urllib_parse
  2. class Index(object):
  3. def __init__(self, url):
  4. self.url = url
  5. self.netloc = urllib_parse.urlsplit(url).netloc
  6. self.simple_url = self.url_to_path('simple')
  7. self.pypi_url = self.url_to_path('pypi')
  8. self.pip_json_url = self.url_to_path('pypi/pip/json')
  9. def url_to_path(self, path):
  10. return urllib_parse.urljoin(self.url, path)
  11. PyPI = Index('https://pypi.python.org/')