/usr/lib/python2.7/site-packages/urllib3
NameSizeModeActions
contrib/-0755rm
packages/-0755rm
util/-0755rm
connection.py143460644editdlrm
connection.pyc125970644editdlrm
connection.pyo125970644editdlrm
connectionpool.py350970644editdlrm
connectionpool.pyc268050644editdlrm
connectionpool.pyo268050644editdlrm
exceptions.py66040644editdlrm
exceptions.pyc127880644editdlrm
exceptions.pyo127880644editdlrm
fields.py59430644editdlrm
fields.pyc66970644editdlrm
fields.pyo66970644editdlrm
filepost.py24360644editdlrm
filepost.pyc33670644editdlrm
filepost.pyo33670644editdlrm
poolmanager.py169850644editdlrm
poolmanager.pyc149650644editdlrm
poolmanager.pyo149650644editdlrm
request.py59910644editdlrm
request.pyc60320644editdlrm
request.pyo60320644editdlrm
response.py256090644editdlrm
response.pyc219000644editdlrm
response.pyo219000644editdlrm
_collections.py107460644editdlrm
_collections.pyc129210644editdlrm
_collections.pyo129210644editdlrm
__init__.py27220644editdlrm
__init__.pyc26400644editdlrm
__init__.pyo26400644editdlrm
Edit: /usr/lib/python2.7/site-packages/urllib3/poolmanager.pyo (14965B)
σ nf·\c@@s”ddlmZddlZddlZddlZddlmZddlmZm Z ddlm Z ddl m Z m Z mZddlmZdd lmZdd lmZdd lmZdd lmZd ddgZejeƒZd6Zd7Zejd/eƒZ d0„Z!iej"e!e ƒd16ej"e!e ƒd26Z#ied16e d26Z$d efd3„ƒYZ%de%fd4„ƒYZ&d5„Z'dS(8i(tabsolute_importNi(tRecentlyUsedContainer(tHTTPConnectionPooltHTTPSConnectionPool(tport_by_scheme(tLocationValueErrort MaxRetryErrortProxySchemeUnknown(tsix(turljoin(tRequestMethods(t parse_url(tRetryt PoolManagert ProxyManagertproxy_from_urltkey_filet cert_filet cert_reqstca_certst ssl_versiont ca_cert_dirt ssl_contextt key_schemetkey_hosttkey_portt key_timeoutt key_retriest key_strictt key_blocktkey_source_addresst key_key_filet key_cert_filet key_cert_reqst key_ca_certstkey_ssl_versiontkey_ca_cert_dirtkey_ssl_contextt key_maxsizet key_headerst key__proxytkey__proxy_headerstkey_socket_optionstkey__socks_optionstkey_assert_hostnametkey_assert_fingerprinttkey_server_hostnametPoolKeycC@s|jƒ}|djƒ|d<|djƒ|d>> manager = PoolManager(num_pools=2) >>> r = manager.request('GET', 'http://google.com/') >>> r = manager.request('GET', 'http://google.com/mail') >>> r = manager.request('GET', 'http://yahoo.com/') >>> len(manager.pools) 2 i cK@sMtj||ƒ||_t|dd„ƒ|_t|_tjƒ|_dS(Nt dispose_funccS@s |jƒS(N(tclose(tp((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pytt(R t__init__tconnection_pool_kwRtpoolstpool_classes_by_schemetkey_fn_by_schemeR7(tselft num_poolsR2RQ((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyRP™s    cC@s|S(N((RU((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyt __enter__€scC@s|jƒtS(N(tcleartFalse(RUtexc_typetexc_valtexc_tb((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyt__exit__§s cC@sŒ|j|}|dkr+|jjƒ}nxdD]}|j|dƒq2W|dkr|x!tD]}|j|dƒq_Wn||||S(s· Create a new :class:`ConnectionPool` based on host, port, scheme, and any additional pool keyword arguments. If ``request_context`` is provided, it is provided as keyword arguments to the pool class used. This method is used to actually create the connection pools handed out by :meth:`connection_from_url` and companion methods. It is intended to be overridden for customization. R0R1tportRIN(R0R1R^(RSR9RQR7R@t SSL_KEYWORDS(RUR0R1R^RCtpool_clsREtkw((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyt _new_pool¬s     cC@s|jjƒdS(s΄ Empty our store of pools and direct them all to close. This will not affect in-flight connections, but they will not be re-used after completion. N(RRRX(RU((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyRXΗsRIcC@sz|stdƒ‚n|j|ƒ}|p-d|d<|sYtj|djƒdƒ}n||d<||d<|j|ƒS(s Get a :class:`ConnectionPool` based on the host, port, and scheme. If ``port`` isn't given, it will be derived from the ``scheme`` using ``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is provided, it is merged with the instance's ``connection_pool_kw`` variable and used to create the new connection pool, if one is needed. sNo host specified.RIR0iPR^R1(Rt_merge_pool_kwargsRR<R8tconnection_from_context(RUR1R^R0t pool_kwargsRC((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pytconnection_from_hostΠs   cC@s<|djƒ}|j|}||ƒ}|j|d|ƒS(sβ Get a :class:`ConnectionPool` based on the request context. ``request_context`` must at least contain the ``scheme`` key and its value must be a key in ``key_fn_by_scheme`` instance variable. R0RC(R8RTtconnection_from_pool_key(RURCR0tpool_key_constructortpool_key((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyRdηs  c C@sy|jjg|jj|ƒ}|r)|S|d}|d}|d}|j|||d|ƒ}||j| %sN(R RfR1R^R0RYR2R7tproxyR9turlopent request_uritget_redirect_locationR tstatusR<t isinstanceR tfrom_inttremove_headers_on_redirectt is_same_hostR>RtiterkeysR8R@t incrementRtraise_on_redirecttlogtinfo( RUtmethodRlRtRaRmtconnRwtredirect_locationRvR2theader((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyRz/sD $      "    N(t__name__t __module__t__doc__R9RyRPRWR]RbRXRfRdRgRnRctTrueRz(((s7/usr/lib/python2.7/site-packages/urllib3/poolmanager.pyR {s       cB@sJeZdZdddd„Zdddd„Zdd„Zed„ZRS(sx Behaves just like :class:`PoolManager`, but sends all requests through the defined proxy, using the CONNECT method for HTTPS URLs. :param proxy_url: The URL of the proxy to be used. :param proxy_headers: A dictionary containing headers that will be sent to the proxy. In case of HTTP they are being sent with each request, while in the HTTPS/CONNECT case they are sent only once. Could be used for proxy authentication. Example: >>> proxy = urllib3.ProxyManager('http://localhost:3128/') >>> r1 = proxy.request('GET', 'http://google.com/') >>> r2 = proxy.request('GET', 'http://httpbin.org/') >>> len(proxy.pools) 1 >>> r3 = proxy.request('GET', 'https://httpbin.org/') >>> r4 = proxy.request('GET', 'https://twitter.com/') >>> len(proxy.pools) 3 i cK@sΰt|tƒr.d|j|j|jf}nt|ƒ}|jsmtj|jdƒ}|jd|ƒ}n|jdkrŽt |jƒ‚n||_ |p i|_ |j |d<|j |dsf    5 ςW