コード例 #1
0
 def setup(self, proxystr='', prompting=True):
     """
     Sets the proxy handler given the option passed on the command
     line.  If an empty string is passed it looks at the HTTP_PROXY
     environment variable.
     """
     self.prompting = prompting
     proxy = self.get_proxy(proxystr)
     if proxy:
         proxy_support = urllib2.ProxyHandler({"http": proxy, "ftp": proxy})
         opener = urllib2.build_opener(proxy_support, urllib2.CacheFTPHandler)
         urllib2.install_opener(opener)
コード例 #2
0
 def setup(self, proxystr='', prompting=True):
     """
     Sets the proxy handler given the option passed on the command
     line.  If an empty string is passed it looks at the HTTP_PROXY
     environment variable.
     """
     self.prompting = prompting
     proxy = self.get_proxy(proxystr)
     if proxy:
         proxy_support = urllib2.ProxyHandler({"http": proxy, "ftp": proxy, "https": proxy})
         opener = urllib2.build_opener(proxy_support, urllib2.CacheFTPHandler)
         urllib2.install_opener(opener)