aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-11-14 09:35:20 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-11-14 09:35:20 -0500
commit3822e3e7ad8cda5012b602f7e8f52cdd44665dd3 (patch)
tree6e1c1aa615c5596c7d29e8d8de7a284e8aa42f67 /setuptools/package_index.py
parent2e0ef2a83c7e662b1bd48926c1dc82bc44aa5efd (diff)
downloadexternal_python_setuptools-3822e3e7ad8cda5012b602f7e8f52cdd44665dd3.tar.gz
external_python_setuptools-3822e3e7ad8cda5012b602f7e8f52cdd44665dd3.tar.bz2
external_python_setuptools-3822e3e7ad8cda5012b602f7e8f52cdd44665dd3.zip
Delint syntax
--HG-- extra : amend_source : 0f58aa917ebc71efd2904638fac3838fd0b0e4dd
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index ca228997..a0bb936d 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -920,29 +920,29 @@ def _encode_auth(auth):
# strip the trailing carriage return
return encoded.rstrip()
-class PyPirc:
+class PyPirc(object):
def __init__(self):
"""
- Extract pypirc authentication information from home directory
+ Extract pypirc authentication information from home directory
"""
self.dict_ = {}
- if os.environ.has_key('HOME'):
+ if 'HOME' in os.environ:
rc = os.path.join(os.environ['HOME'], '.pypirc')
if os.path.exists(rc):
config = ConfigParser.ConfigParser({
- 'username' : '',
- 'password' : '',
- 'repository' : ''})
+ 'username': '',
+ 'password': '',
+ 'repository': ''})
config.read(rc)
for section in config.sections():
if config.get(section, 'repository').strip():
- value = '%s:%s'%(config.get(section, 'username').strip(),
+ value = '%s:%s' % (config.get(section, 'username').strip(),
config.get(section, 'password').strip())
self.dict_[config.get(section, 'repository').strip()] = value
-
+
def __call__(self, url):
""" """
for base_url, auth in self.dict_.items():
@@ -950,7 +950,6 @@ class PyPirc:
return auth
-
def open_with_auth(url, opener=urllib2.urlopen):
"""Open a urllib2 request, handling HTTP authentication"""
@@ -968,7 +967,7 @@ def open_with_auth(url, opener=urllib2.urlopen):
if not auth:
auth = PyPirc()(url)
- log.info('Authentication found for URL: %s'%url)
+ log.info('Authentication found for URL: %s' % url)
if auth:
auth = "Basic " + _encode_auth(auth)