Profile: Yoctabyte
10 comments | |
2 xtras |
Latest comments
# by Yoctabyte on 01/26/10 at 22:50:29
this is great! :D it's been a really long time since someone took up the task.
# by Yoctabyte on 08/01/09 at 18:34:37
Uh.. My message got cut off... Lemme just show the lines:
82: return opener.open(url)
185: return self.open_unknown_proxy(proxy, fullurl, data)
204: raise IOError, ('url error', 'invalid proxy for %s' % type, proxy)
82: return opener.open(url)
185: return self.open_unknown_proxy(proxy, fullurl, data)
204: raise IOError, ('url error', 'invalid proxy for %s' % type, proxy)
# by Yoctabyte on 08/01/09 at 18:33:15
# Shortcut for basic usage
_urlopener = None
def urlopen(url, data=None, proxies=None):
"""urlopen(url [, data]) -> open file-like object"""
global _urlopener
if proxies is not None:
opener = FancyURLopener(proxies=proxies)
elif not _urlopener:
opener = FancyURLopener()
_urlopener = opener
else:
opener = _urlopener
if data is None:
return opener.open(url)
_urlopener = None
def urlopen(url, data=None, proxies=None):
"""urlopen(url [, data]) -> open file-like object"""
global _urlopener
if proxies is not None:
opener = FancyURLopener(proxies=proxies)
elif not _urlopener:
opener = FancyURLopener()
_urlopener = opener
else:
opener = _urlopener
if data is None:
return opener.open(url)
# by Yoctabyte on 01/26/10 at 22:52:07