ok

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/M2Crypto/
Upload File :
Current File : //usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyo

�
z\Vc@sdZddlZddlTddlZddlZddlZdejfd��YZdefd��YZ	dd�ZdS(	s�
M2Crypto enhancement to Python's urllib2 for handling 
'https' url's.

Code from urllib2 is Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007
Python Software Foundation; All Rights Reserved

Summary of changes:
 - Use an HTTPSProxyConnection if the request is going through a proxy.
 - Add the SSL context to the https connection when performing https_open.
 - Add the M2Crypto HTTPSHandler when building a default opener.
i����N(t*t_closing_fileobjectcBs eZdZd�Zd�ZRS(s�socket._fileobject that propagates self.close() to the socket.

    Python 2.5 provides this as socket._fileobject(sock, close=True).
    cCstjj||�dS(N(tsockett_fileobjectt__init__(tselftsock((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyRscCs'|j}tjj|�|j�dS(N(t_sockRRtclose(RR((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyRs	(t__name__t
__module__t__doc__RR(((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyRs	tHTTPSHandlercBs&eZdd�Zd�ZejZRS(cCs8tj|�|dk	r%||_ntj�|_dS(N(tAbstractHTTPHandlerRtNonetctxtSSLtContext(Rtssl_context((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyR%s
cCs�|j�}|s!td��n|j�}tj|�d}||kr}tj|�d}tjd|d|j�}n'|j�}tj	d|d|j�}|j
|j�t|j
�}|j|j�d|d<y/|j|j�||j|�|j�}Wn"tjk
r0}	t|	��nX|j|_t|�}
t|
|j|j��}|j|_|j|_|S(s�Return an addinfourl object for the request, using http_class.

        http_class must implement the HTTPConnection API from httplib.
        The addinfourl return value is a file-like object.  It also
        has methods and attributes including:
            - info(): return a mimetools.Message object for the headers
            - geturl(): return the original request URL
            - code: HTTP status code
        s
no host giveniithostRRt
Connection(tget_hosttURLErrortget_full_urlturlparset	urldefragthttpslibtProxyHTTPSConnectionRtget_selectortHTTPSConnectiontset_debuglevelt_debugleveltdicttheaderstupdatetunredirected_hdrstrequestt
get_methodtdatatgetresponseRterrortreadtrecvRt
addinfourltmsgtstatustcodetreason(RtreqRtfull_urlttarget_hosttrequest_urithR!trterrtfptresp((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyt
https_open/s2


N(R	R
RRR9R
tdo_request_t
https_request(((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyR$s
	?c	sRddl��fd�}t�}tttttttt	g}g}xl|D]d}x[|D]S}||�r�t
||�r�|j|�q�q\t||�r\|j|�q\q\WqOWx|D]}|j
|�q�Wx|D]}|j|��q�Wt|kr|jt|��nx3|D]+}||�r=|�}n|j|�qW|S(sCreate an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP and FTP.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
    i����Ncst|�j�pt|d�S(Nt	__bases__(t
isinstancet	ClassTypethasattr(tobj(ttypes(s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pytisclass|s(RAtOpenerDirectortProxyHandlertUnknownHandlertHTTPHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlert
FTPHandlertFileHandlertHTTPErrorProcessort
issubclasstappendR=tremovetadd_handlerR(	RthandlersRBtopenertdefault_classestskiptklasstcheckR4((RAs8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pytbuild_openerrs2			




(RRturllib2RRRRRR
RRRV(((s8/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib2.pyt<module>s
N

Zerion Mini Shell 1.0