Exemplo n.º 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, "https": proxy})
         opener = urllib2.build_opener(proxy_support, urllib2.CacheFTPHandler)
         urllib2.install_opener(opener)
Exemplo n.º 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:
         self.proxy_handler = urllib2.ProxyHandler({
             "http": proxy,
             "ftp": proxy,
             "https": proxy
         })