diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-05-17 10:39:07 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-05-17 10:39:07 (GMT) |
commit | e127e24359d01742fe0aff8fa5bc949f166071ca (patch) | |
tree | 47dd44bb7a53ad26224173b95bfa199f39fa5456 /Lib | |
parent | 422545f0e7c83703d3a35ab85a210e19aa40332d (diff) | |
download | cpython-e127e24359d01742fe0aff8fa5bc949f166071ca.zip cpython-e127e24359d01742fe0aff8fa5bc949f166071ca.tar.gz cpython-e127e24359d01742fe0aff8fa5bc949f166071ca.tar.bz2 |
Slight style cleanup.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/urllib.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 6cb95f3..be91a2d 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -765,7 +765,7 @@ class FancyURLopener(URLopener): else: return self.open(newurl, data) - def get_user_passwd(self, host, realm, clear_cache = 0): + def get_user_passwd(self, host, realm, clear_cache=0): key = realm + '@' + host.lower() if key in self.auth_cache: if clear_cache: @@ -1157,7 +1157,8 @@ def splitvalue(attr): return attr, None _hexdig = '0123456789ABCDEFabcdef' -_hextochr = dict((a+b, chr(int(a+b,16))) for a in _hexdig for b in _hexdig) +_hextochr = dict((a + b, chr(int(a + b, 16))) + for a in _hexdig for b in _hexdig) def unquote(s): """unquote('abc%20def') -> 'abc def'.""" @@ -1182,7 +1183,7 @@ always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' '0123456789' '_.-') _safemaps = {} -def quote(s, safe = '/'): +def quote(s, safe='/'): """quote('abc def') -> 'abc%20def' Each part of a URL, e.g. the path info, the query, etc., has a @@ -1216,14 +1217,14 @@ def quote(s, safe = '/'): res = map(safe_map.__getitem__, s) return ''.join(res) -def quote_plus(s, safe = ''): +def quote_plus(s, safe=''): """Quote the query fragment of a URL; replacing ' ' with '+'""" if ' ' in s: s = quote(s, safe + ' ') return s.replace(' ', '+') return quote(s, safe) -def urlencode(query,doseq=0): +def urlencode(query, doseq=0): """Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each @@ -1380,7 +1381,6 @@ if sys.platform == 'darwin': return False - def getproxies_macosx_sysconf(): """Return a dictionary of scheme -> proxy server URL mappings. @@ -1389,8 +1389,6 @@ if sys.platform == 'darwin': """ return _get_proxies() - - def proxy_bypass(host): if getproxies_environment(): return proxy_bypass_environment(host) |