Did I find the right examples for you? yes no

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
Use a proxy for future urllib2.urlopen commands.

The specified pinfo should be a dictionary containing the following:
    * host: the servername of the proxy
    * port: the port to use on the proxy server
    * user: (optional) username for authenticating with the proxy server.
    * pass: (optional) password for authenticating with the proxy server.

        def install_proxy_handlers(pinfo):
    """
    Use a proxy for future urllib2.urlopen commands.

    The specified pinfo should be a dictionary containing the following:
        * host: the servername of the proxy
        * port: the port to use on the proxy server
        * user: (optional) username for authenticating with the proxy server.
        * pass: (optional) password for authenticating with the proxy server.

    """

    proxystr = get_proxystr(pinfo)

    if proxystr:
        proxies = dict(http=proxystr, https=proxystr)
        handler = urllib2.ProxyHandler(proxies)

        # Create a proxy opener and install it.
        opener = urllib2.build_opener(handler)
        urllib2.install_opener(opener)

    return
        


src/e/t/ETSProjectTools-0.6.0/enthought/proxy/api.py   ETSProjectTools(Download)
from connect_HTTP_handler import ConnectHTTPHandler
from connect_HTTPS_handler import ConnectHTTPSHandler
from util import install_proxy_handlers, setup_authentication, setup_proxy
 
 

src/e/n/enstaller-4.6.4/enstaller/proxy/api.py   enstaller(Download)
 
 
from util import install_proxy_handlers, setup_proxy