pypa/pip — pull request #2199 by msabramo (2014-12-16 06:40:21+00:00)
Title: Reduce duplication of "pypi.python.org"

by creating a `PyPI` object (of class `Index`)

Inspired by [comment](https://github.com/pypa/pip/pull/2183#issuecomment-66967168) from @xavfernandez:

> I'm surprised "pypi.python.org" is not a constant defined somewhere in pip's code, just like distlib seems to do

Before:

$ ag --ignore=_vendor 'pypi.python.org' pip
pip/cmdoptions.py
195: default='https://pypi.python.org/simple/',

pip/commands/search.py
33: default='https://pypi.python.org/pypi',

pip/index.py
305: if page is None and 'pypi.python.org' not in str(main_index_url):
706: ).netloc.endswith("pypi.python.org")):

pip/utils/outdated.py
107: "https://pypi.python.org/pypi/pip/json",

After:

$ ag --ignore=_vendor 'pypi.python.org' pip
pip/index.py
77:PyPI = Index(url='https://pypi.python.org/', trusted=True)