Current File : //lib/python2.7/site-packages/httplib2/__init__.pyo
�
7�Yc@spddlmZdZdZdddddd	d
gZdZdZdd
lZdd
lZdd
l	Z	dd
l
Z	dd
lZ	dd
lZ	dd
l
Z
dd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZyddlmZmZWn;ek
r~dd
l Z dd
lZe j!Zej!ZnXdd
l"Z"ddl#m#Z$dd
l%Z%yddl&m'Z'WnAek
r�ydd
l'Z'Wnee(fk
r�e)Z'nXnXy"dd
l*Z*e*j+Z,d�Z-Wn&e(efk
rIe)Z,d�Z-nXej.ddfkrrddl/m/Z/n	d�Z/d�Z0ddddddddd d!d"gZ1d#Z2dZ3ej.dd$fkr�d%�Z4nd&�Z5e6ej7d'�re5ej7_8nde9fd(��YZ:d)e:fd*��YZ;de;fd+��YZ<de;fd,��YZ=de;fd-��YZ>de;fd.��YZ?d e;fd/��YZ@d0e:fd1��YZAd2e:fd3��YZBd4e:fd5��YZCd"e:fd6��YZDd7e:fd8��YZEd9e:fd:��YZFd;e:fd<��YZGd=eFfd>��YZHd?ZIydd
lJZJeJjK�ZLWnek
r�d@ZLnXdAdBdCdDdEdFdGdHgZMdI�ZNejOdJ�ZPdK�ZQdL�ZRejOdM�ZSejOdN�ZTdO�ZUejOdP�ZVdQ�ZWdR�ZXd#ZYejOdS�ZZejOdT�Z[ejOdU�Z\dVdW�Z]dX�Z^dY�Z_dZ�Z`d[�Zad\�Zbd]ecfd^��YZdd_edfd`��YZedaedfdb��YZfdcedfdd��YZgdeedfdf��YZhdgedfdh��YZiieedi6ehdj6efdk6egdl6eidm6ZjdldmdkdjdigZkdnecfdo��YZldpecfdq��YZmdremfds��YZndtecfdu��YZodecfdv��YZpdwdx�Zqdwdy�Zrdzejsfd{��YZtd|ejufd}��YZvietdw6evd~6ZwyyUddlxmyZyeyjzj{d��e)krJe�ndd�l|m}Z}dd�l|m~Z~Wnhee(fk
r�ddlmyZyeyjzj{d��e)kr�e�ndd�l�m}Z}dd�l�m~Z~nXd��Z�d�ejsfd���YZ�d�ejufd���YZ�ie�dw6e�d~6ZwWnee(fk
r?nXdecfd���YZ�de�fd���YZ�d
S(�i����(t
generatorss!Joe Gregorio (joe@bitworking.org)sCopyright 2006, Joe Gregorios!Thomas Broyer (t.broyer@ltgt.net)sJames AntillsXavier Verges FarrerosJonathan FeinbergsBlair ZajacsSam RubysLouis NyffeneggertMITs0.9.2N(tsha1tmd5(tgettext(tsocksc
Cs@|rtj}n	tj}tj|d|d|d|d|�S(Ntkeyfiletcertfilet	cert_reqstca_certs(tsslt	CERT_NONEt
CERT_REQUIREDtwrap_socket(tsocktkey_filet	cert_filetdisable_validationR	R((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_ssl_wrap_socketFs
	cCs:|std��ntj|||�}tj||�S(Ns�SSL certificate validation is not supported without the ssl module installed. To avoid this error, install the ssl module, or explicity disable validation.(t CertificateValidationUnsupportedtsocketR
thttplibt
FakeSocket(RRRRR	tssl_sock((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRSs
ii(tiri2uricCs|S(N((turi((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRascCs2ttd�r(|dk	o'|tjk	S|dk	S(Nt_GLOBAL_DEFAULT_TIMEOUT(thasattrRtNoneR(ttimeout((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pythas_timeoutdstHttptResponset	ProxyInfot
HttpLib2ErrortRedirectMissingLocationt
RedirectLimittFailedToDecompressContentt"UnimplementedDigestAuthOptionErrort&UnimplementedHmacDigestAuthOptionErrort
debugleveltProxiesUnavailableErroriicCs|j�|S(N(tsort(tseq((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytsortedys
cCs+|jdkrtj��n|jj�S(s&Return list of (header, value) tuples.N(tmsgRRtResponseNotReadytitems(tself((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytHTTPResponse__getheaders~st
getheaderscBseZRS((t__name__t
__module__(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR"�stHttpLib2ErrorWithResponsecBseZd�ZRS(cCs&||_||_tj||�dS(N(tresponsetcontentR"t__init__(R0tdescR6R7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s		(R3R4R8(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR5�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR#�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR$�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR%�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR&�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR'�stMalformedHeadercBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR:�stRelativeURIErrorcBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR;�stServerNotFoundErrorcBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR<�scBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR)�sRcBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�stSSLHandshakeErrorcBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR=�stNotSupportedOnThisPlatformcBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR>�stCertificateHostnameMismatchcBseZd�ZRS(cCs&tj||�||_||_dS(N(R"R8thosttcert(R0R9R@RA((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s	(R3R4R8(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR?�sis /etc/pki/tls/certs/ca-bundle.crtt
connections
keep-alivesproxy-authenticatesproxy-authorizationttettrailersstransfer-encodingtupgradecCsptt�}|jg|jdd�jd�D]}|j�^q.�g|j�D]}||krT|^qTS(NRBtt,(tlistt
HOP_BY_HOPtextendtgettsplittstriptkeys(R6thopbyhoptxtheader((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_get_end2end_headers�s;s9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?cCs<tj|�j�}|d|d|d|d|dfS(s�Parses a URI using the regex given in Appendix B of RFC 3986.

        (scheme, authority, path, query, fragment) = parse_uri(uri)
    iiiii(tURItmatchtgroups(RRU((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt	parse_uri�scCs�t|�\}}}}}|s)|r<td|��n|j�}|j�}|scd}n|r~dj||g�p�|}|j�}|d||}||||fS(Ns(Only absolute URIs are allowed. uri = %st/t?s://(RVR;tlowertjoin(Rtschemet	authoritytpathtquerytfragmenttrequest_urit
defrag_uri((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyturlnorm�s	!s^\w+://s[?/:|]+cCs�yUtj|�rTt|t�rB|jd�}|jd�}qT|jd�}nWntk
rhnXt|t�r�|jd�}nt|�j	�}tj
d|�}tj
d|�}t|�dkr�|d }ndj
||f�S(s�Return a filename suitable for the cache.

    Strips dangerous and common characters to create a filename we
    can use to store the cache in.
    sutf-8tidnaRFRGi�(t
re_url_schemeRTt
isinstancetstrtdecodetencodetUnicodeErrortunicodet_md5t	hexdigesttsubtre_slashtlenRZ(tfilenametfilemd5((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytsafename�s 

s(?:\r\n)?[ \t]+cCsGtg|j�D]0\}}|j�tj|d�j�f^q�S(Nt (tdictt	iteritemsRYtNORMALIZE_SPACERmRM(theaderstkeytvalue((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_normalize_headers	scCs�i}|jd�r�|djd�}g|D]R}d|jd�kr/tg|jdd�D]}|j�j�^q`�^q/}g|D]3}d|jd�kr�|j�j�df^q�}t||�}n|S(Ns
cache-controlRGi����t=i(thas_keyRLtfindttupleRMRYRt(RwtretvaltpartstpartRPtparts_with_argstnamet
parts_wo_args((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_parse_cache_controls_@s�^(?:\s*(?:,\s*)?([^\0-\x1f\x7f-\xff()<>@,;:\\\"/[\]?={} \t]+)\s*=\s*\"?((?<=\")(?:[^\0-\x08\x0A-\x1f\x7f-\xff\\\"]|\\[\0-\x7f])*?(?=\")|(?<!\")[^\0-\x1f\x7f-\xff()<>@,;:\\\"/[\]?={} \t]+(?!\"))\"?)(.*)$sk^(?:\s*(?:,\s*)?([^ \t\r\n=]+)\s*=\s*\"?((?<=\")(?:[^\\\"]|\\.)*?(?=\")|(?<!\")[^ \t\r\n,]+(?!\"))\"?)(.*)$s\\(.)swww-authenticatecCsBi}|j|�r>y||j�}tr4tp7t}x�|r|dkr_d|}}n|jdd�\}}|j|�}i}xk|r�|r�t|j��dkr�|j�\}	}
}t	j
d|
�||	j�<n|j|�}q�W|||j�<|j�}q=WWq>tk
r:t
d��q>Xn|S(sCReturns a dictionary of dictionaries, one dict
    per auth_scheme.sauthentication-infotdigestRsiis\1sWWW-Authenticate(R|RMtUSE_WWW_AUTH_STRICT_PARSINGtWWW_AUTH_STRICTtWWW_AUTH_RELAXEDRLtsearchRoRUt
UNQUOTE_PAIRSRmRYt
ValueErrorR:(Rwt
headernameRtauthenticatetwww_authtauth_schemetthe_restRTtauth_paramsRxRy((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_parse_www_authenticate#s*		
cCsHd}t|�}t|�}|jd�rn|dj�jd�dkrnd}d|krDd|d<qDn�|jd�r�d}n�|jd�r�d}n�|jd�r�d}n�|jd	�rDtjtjj|d	��}t	j	�}t
d
||�}|jd�rCyt|d�}Wq�tk
r?d
}q�Xn_|jd�r�tjj|d�}	d|	kr}d
}q�t
d
tj|	�|�}nd
}|jd�r�yt|d�}Wq�tk
r�d
}q�Xn|jd
�r,yt|d
�}
Wntk
rd
}
nX||
7}n||krDd}qDn|S(s�Determine freshness from the Date, Expires and Cache-Control headers.

    We don't handle the following:

    1. Cache-Control: max-stale
    2. Age: headers are not used in the calculations.

    Not that this algorithm is simpler than you might think
    because we are operating as a private (non-shared) cache.
    This lets us ignore 's-maxage'. We can also ignore
    'proxy-invalidate' since we aren't a proxy.
    We will never return a stale document as
    fresh as a design decision, and thus the non-implementation
    of 'max-stale'. This also lets us safely ignore 'must-revalidate'
    since we operate as if every server has sent 'must-revalidate'.
    Since we are private we get to ignore both 'public' and
    'private' parameters. We also ignore 'no-transform' since
    we don't do any transformations.
    The 'no-store' parameter is handled at a higher level.
    So the only Cache-Control parameters we look at are:

    no-cache
    only-if-cached
    max-age
    min-fresh
    tSTALEtpragmasno-cachei����tTRANSPARENTs
cache-controlsonly-if-cachedtFRESHtdateismax-agetexpiress	min-freshN(R�R|RYR}tcalendarttimegmtemailtUtilstparsedate_tzttimetmaxtintR�R(tresponse_headerstrequest_headersRtcctcc_responseR�tnowtcurrent_agetfreshness_lifetimeR�t	min_fresh((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_entry_dispositionCsT.			

	




cCs�|}y�|jdd�}|d	kr�|dkrWtjdtj|��j�}n|dkrutj|�}ntt	|��|d<|d|d<|d=nWn<t
k
r�d}ttd�|jd�||��nX|S(
Nscontent-encodingtgziptdeflatetfileobjscontent-lengths-content-encodingRFsDContent purported to be compressed with %s but failed to decompress.(sgzipR�(
RKRR�tGzipFiletStringIOtreadtzlibt
decompressRfRotIOErrorR%t_(R6tnew_contentR7tencoding((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_decompressContent�s$
)cCs�|r�t|�}t|�}|jd�s<|jd�rL|j|�q�tjj�}x3|j�D]%\}}	|dkrh|	||<qhqhW|jdd�}
|
r|
j�j	dd�j
d�}xA|D]6}d	|}y||||<Wq�tk
rq�Xq�Wn|j}
|
d
kr,d}
nd|
}|j
�}tjd
d|�}dj|||g�}|j||�ndS(Nsno-storetstatusscontent-encodingstransfer-encodingtvaryRsRFRGs
-varied-%si0i�sstatus: %d
s
(?!
)|(?<!
)
s
(sstatusscontent-encodingstransfer-encoding(R�R|tdeleteR�tMessageRuRKRRYtreplaceRLtKeyErrorR�t	as_stringtreRmRZtset(R�R�R7tcachetcachekeyR�R�tinfoRxRyR�tvary_headersRQR�t
status_headert
header_strttext((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_updateCache�s4!


		
c	CsStdtj�gtd�D]}dtjdd�^qf�j�}|d S(Ns%s:%sit
0123456789ii	i(RkR�tctimetrangetrandomt	randrangeRl(titdig((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_cnonce�sKcCs,tjtd|||f�j��j�S(Ns%s%s%s(tbase64t	b64encodet_shaR�RM(tcnoncetiso_nowtpassword((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_wsse_username_token�stAuthenticationcBs5eZd�Zd�Zd�Zd�Zd�ZRS(c
CsCt|�\}}	}
}}|
|_||_||_||_dS(N(RVR]R@tcredentialsthttp(
R0R�R@R`RwR6R7R�R[R\R]R^R_((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s
			cCs5t|�\}}}}}|t|j�jd�S(NRW(RVRoR]tcount(R0R`R[R\R]R^R_((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytdepth�scCs:t|�\}}}}}||jko9|j|j�S(N(RVR@t
startswithR](R0R@R`R[R\R]R^R_((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytinscope�scCsdS(snModify the request headers to add the appropriate
        Authorization header. Over-ride this in sub-classes.N((R0tmethodR`RwR7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytrequest�scCstS(sGives us a chance to update with new nonces
        or such returned from the last authorized response.
        Over-rise this in sub-classes if necessary.

        Return TRUE is the request is to be retried, for
        example Digest may return stale=true.
        (tFalse(R0R6R7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR6�s(R3R4R8R�R�R�R6(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s
				tBasicAuthenticationcBseZd�Zd�ZRS(c	Cs&tj||||||||�dS(N(R�R8(R0R�R@R`RwR6R7R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�scCs(dtjd|j�j�|d<dS(sOModify the request headers to add the appropriate
        Authorization header.sBasic s%s:%st
authorizationN(R�R�R�RM(R0R�R`RwR7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s(R3R4R8R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s	tDigestAuthenticationcBs,eZdZd�Zdd�Zd�ZRS(sMOnly do qop='auth' and MD5, since that
    is all Apache currently implementsc	CsYtj||||||||�t|d�}|d|_|jjdd�}	dg|	j�D]}
|
j�^qckr�dp�d|jd<|jddkr�tt	d|	���n|jjdd�j
�|jd<|jddkrtt	d|jd���nd	j|jd
d|jdd|jd
g�|_
d
|jd<dS(Nswww-authenticateR�tqoptauthsUnsupported value for qop: %s.t	algorithmtMD5s$Unsupported value for algorithm: %s.RFit:trealmitnc(R�R8R�t	challengeRKRLRMRR&R�tupperRZR�tA1(R0R�R@R`RwR6R7R�R�R�RP((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8s"
>" 6c	s<d���fd�}dj|d|g�}|p<t�|jd<d|�|j�d|jdd	|jd
|jd|jd�|�f�}d|jd
|jd|jd||jd||jd|jd
|jdf	|d<|jjd�r%|dcd|jd7<n|jd
cd7<dS(sModify the request headerscSst|�j�S(N(RkRl(RP((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt<lambda>scs�d||f�S(Ns%s:%s((tstd(tH(s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�sRFR�R�s"%s"s%s:%s:%s:%s:%stnonces%08xR�R�soDigest username="%s", realm="%s", nonce="%s", uri="%s", algorithm=%s, response=%s, qop=%s, nc=%08x, cnonce="%s"iR�R�R�topaques
, opaque="%s"iN(RZR�R�R�R�RK(	R0R�R`RwR7R�tKDtA2trequest_digest((R�s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�s,	







cCs�|jd�sdt|d�jdi�}d|jd�kr�|d|jd<d|jd<tSnKt|d�jdi�}|jd	�r�|d	|jd<d|jd<ntS(
Nsauthentication-infoswww-authenticateR�ttruetstaleR�iR�t	nextnonce(R|R�RKR�tTrueR�(R0R6R7R�tupdated_challenge((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR6*s
N(R3R4t__doc__R8RR�R6(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�s	tHmacDigestAuthenticationcBs/eZdZdZd�Zd�Zd�ZRS(s@Adapted from Robert Sayre's code and DigestAuthentication above.s!Thomas Broyer (t.broyer@ltgt.net)c		Cs:tj||||||||�t|d�}|d|_|jjdd�|jd<|jddkr}d|jd<n|jjdd�|jd<|jjd�s�ttd	���n|jjd
d�|jd
<|jd
dkrttd
|jd
���n|jjdd�|jd<|jddkr^ttd|jd���n|jd
dkr}t|_n	t	|_|jddkr�t|_
n	t	|_
dj|jdd|j
j
dj|jd|jdg��j�j�d|jdg�|_|j
j
|j�j�j�|_dS(Nswww-authenticatet
hmacdigesttreasontunauthorizedt	integritytsaltRFtsnoncesCThe challenge doesn't contain a server nonce, or this one is empty.R�s
HMAC-SHA-1sHMAC-MD5s$Unsupported value for algorithm: %s.spw-algorithmsSHA-1R�s'Unsupported value for pw-algorithm: %s.iR�iR�(RR(s
HMAC-SHA-1sHMAC-MD5(sSHA-1sMD5(R�R8R�R�RKR'R�RkthashmodR�t	pwhashmodRZR�tnewRlRYRx(	R0R�R@R`RwR6R7R�R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8>s2"
  		8c	Cs�t|�}djg|D]}d|^q�}djg|D]}||^q?�}tjdtj��}	t�}
d|||
|jd|f}tj|j	||j
�j�j�}d|j
d|jd|jd|
||	||f|d	<d
S(sModify the request headersRFs%s s%Y-%m-%dT%H:%M:%SZs%s:%s:%s:%s:%sRssHMACDigest username="%s", realm="%s", snonce="%s", cnonce="%s", uri="%s", created="%s", response="%s", headers="%s"iR�R�N(RRRZR�tstrftimetgmtimeR�R�thmacRRxRRlRYR�(R0R�R`RwR7RNtktkeylisttheaders_valtcreatedR�R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�\s &&	 '


cCs8t|d�jdi�}|jd�dkr4tStS(Nswww-authenticateR�RRR�(s	integritysstale(R�RKR�R�(R0R6R7R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR6os(R3R4R�t
__author__R8R�R6(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�:s
		tWsseAuthenticationcBs eZdZd�Zd�ZRS(s�This is thinly tested and should not be relied upon.
    At this time there isn't any third party server to test against.
    Blogger and TypePad implemented this algorithm at one point
    but Blogger has since switched to Basic over HTTPS and
    TypePad has implemented it wrong, by never issuing a 401
    challenge but instead requiring your client to telepathically know that
    their endpoint is expecting WSSE profile="UsernameToken".c	Cs&tj||||||||�dS(N(R�R8(R0R�R@R`RwR6R7R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8~scCsid|d<tjdtj��}t�}t|||jd�}d|jd|||f|d<dS(	sOModify the request headers to add the appropriate
        Authorization header.sWSSE profile="UsernameToken"R�s%Y-%m-%dT%H:%M:%SZisJUsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"isX-WSSEN(R�RR	R�R�R�(R0R�R`RwR7R�R�tpassword_digest((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s
	
(R3R4R�R8R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRvs	tGoogleLoginAuthenticationcBseZd�Zd�ZRS(cCsWddlm}tj||||||||�t|d�}	|	djdd�}
|
dkr�|jd�dkr�d	}
ntd
|dd|dd|
d
|d�}|jj	dddd||�didd6�\}}|j
d�}
tg|
D]$}|r�t|j
dd��^q��}|jdkrFd|_
n
|d|_
dS(Ni����(t	urlencodeswww-authenticatetgooglelogintservicetxapiR�itcltEmailtPasswditsources
user-agents+https://www.google.com/accounts/ClientLoginR�tPOSTtbodyRws!application/x-www-form-urlencodedsContent-Types
R{i�RFtAuth(turllibRR�R8R�RKR}RtR�R�RLR~R�R(R0R�R@R`RwR6R7R�RR�RR�tresptlinestlineR�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s"!	-77cCsd|j|d<dS(sOModify the request headers to add the appropriate
        Authorization header.sGoogleLogin Auth=R�N(R(R0R�R`RwR7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s(R3R4R8R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�s	tbasictwsseR�R�Rt	FileCachecBs5eZdZed�Zd�Zd�Zd�ZRS(s�Uses a local directory as a store for cached files.
    Not really safe to use if multiple threads or processes are going to
    be running on the same cache.
    cCs;||_||_tjj|�s7tj|j�ndS(N(R�tsafetosR]texiststmakedirs(R0R�R%((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s		cCshd}tjj|j|j|��}y)t|d�}|j�}|j�Wnt	k
rcnX|S(Ntrb(
RR&R]RZR�R%tfileR�tcloseR�(R0RxRt
cacheFullPathtf((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRK�s!
cCsKtjj|j|j|��}t|d�}|j|�|j�dS(Ntwb(R&R]RZR�R%R*twriteR+(R0RxRyR,R-((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s!
cCsGtjj|j|j|��}tjj|�rCtj|�ndS(N(R&R]RZR�R%R'tremove(R0RxR,((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s!(R3R4R�RrR8RKR�R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR$�s
		tCredentialscBs/eZd�Zdd�Zd�Zd�ZRS(cCs
g|_dS(N(R�(R0((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�sRFcCs#|jj|j�||f�dS(N(R�tappendRY(R0R�R�tdomain((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytadd�scCs
g|_dS(N(R�(R0((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytclear�sccsGx@|jD]5\}}}|dks1||kr
||fVq
q
WdS(NRF(R�(R0R3tcdomainR�R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytiter�s(R3R4R8R4R5R7(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR1�s		tKeyCertscBseZdZRS(sNIdentical to Credentials except that
    name/password are mapped to key/cert.(R3R4R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�stAllHostscBseZRS((R3R4(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR9�scBsJeZdZdZeddd�Zd�Zd�Zd�Z	d�Z
RS(s,Collect information required to use a proxy.cCs:||_||_||_||_||_||_dS(s_
        Args:
          proxy_type: The type of proxy server.  This must be set to one of
          socks.PROXY_TYPE_XXX constants.  For example:

            p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP,
              proxy_host='localhost', proxy_port=8000)

          proxy_host: The hostname or IP address of the proxy server.

          proxy_port: The port that the proxy server is running on.

          proxy_rdns: If True (default), DNS queries will not be performed
          locally, and instead, handed to the proxy to resolve.  This is useful
          if the network does not allow resolution of non-local names.  In
          httplib2 0.9 and earlier, this defaulted to False.

          proxy_user: The username used to authenticate with the proxy server.

          proxy_pass: The password used to authenticate with the proxy server.
        N(t
proxy_typet
proxy_hostt
proxy_portt
proxy_rdnst
proxy_usert
proxy_pass(R0R:R;R<R=R>R?((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s					cCs(|j|j|j|j|j|jfS(N(R:R;R<R=R>R?(R0((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytastuplescCs|jdko|jdkS(N(R;RR<(R0((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytisgoodscCs|j|�S(N(tbypass_host(R0thostname((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt
applies_toscCsI|jtkrtSt}x)|jD]}|j|�r#t}q#q#W|S(s1Has this host been excluded from the proxy config(tbypass_hostsR9R�R�tendswith(R0RCtbypassR3((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRBs
(N(R3R4R�RER�RR8R@RARDRB(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR!�s			R�cCs�|d
krdS|d}tjj|tjj|j���}|sKdSt||�}tjjdtjjdd��}g}|r�|jd�}n|d	kr�t}n||_|S(s9
    Read proxy info from the environment variables.
    R�thttpsNt_proxytno_proxytNO_PROXYRFRGt*(shttpshttps(R&tenvironRKR�tproxy_info_from_urlRLR9RE(R�tenv_varturltpiRJRE((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytproxy_info_from_environment&s
'$		c	
Cs.tj|�}d}d}d}d|dkr}|djdd�\}}d|krt|jdd�\}}q�|}n
|d}d|kr�|jdd�\}}n|}|r�t|�}ntdddd�|}|dkr�d}nd	}td
|d|d|d
|pdd|p*d�S(sG
    Construct a ProxyInfo from a URL (such as http_proxy env var)
    t@iR�RHi�R�iPiiR:R;R<R>R?N(turlparseRRLR�RtR!(	RPR�tusernameR�tporttidentt	host_portR@R:((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRN>s2	
	tHTTPConnectionWithTimeoutcBs,eZdZddddd�Zd�ZRS(s8
    HTTPConnection subclass that supports timeouts

    All timeouts are in seconds. If None is passed for timeout then
    Python's default timeout for sockets will be used. See for example
    the docs of socket.setdefaulttimeout():
    http://docs.python.org/library/socket.html#socket.setdefaulttimeout
    cCs/tjj||||�||_||_dS(N(RtHTTPConnectionR8Rt
proxy_info(R0R@RVtstrictRR[((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8ps	c
Cs�|jr$td
kr$td��nd}|jrx|jj�rxt}|jj�\}}}}}}|}	|}
nt}|j}	|j	}
x�t
j|	|
dt
j�D]�}|\}}
}}}y|r
tj
||
|�|_|jj||||||�n4t
j
||
|�|_|jjt
jt
jd�t|j�rc|jj|j�n|jdkr�d|j|j	fGH|r�dt|||||f�GHq�n|jj|j|j	f|d�Wn�t
jk
ra}|jdkr9d|j|j	fGH|r9d	t|||||f�GHq9n|jrR|jj�nd
|_q�nXPq�W|jst
j|�nd
S(s3Connect to the host and port specified in __init__.s2Proxy support missing but proxy use was requested!s!getaddrinfo returns an empty listiisconnect: (%s, %s) ************sproxy: %s ************isconnect fail: (%s, %s)s	proxy: %sN(R[RRR)RAR�R@R�R@RVRtgetaddrinfotSOCK_STREAMt
socksocketRtsetproxyt
setsockopttIPPROTO_TCPtTCP_NODELAYRRt
settimeoutR(RftconnectterrorR+(R0R-t	use_proxyR:R;R<R=R>R?R@RVtrestaftsocktypetprotot	canonnametsa((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyReusN!			""$($			N(R3R4R�RR8Re(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRYfstHTTPSConnectionWithTimeoutc	BsJeZdZddddddded�Zd�Zd�Zd�ZRS(s2
    This class allows communication via SSL.

    All timeouts are in seconds. If None is passed for timeout then
    Python's default timeout for sockets will be used. See for example
    the docs of socket.setdefaulttimeout():
    http://docs.python.org/library/socket.html#socket.setdefaulttimeout
    c

Cshtjj||d|d|d|d|�||_||_|dkrRt}n||_|	|_dS(NRVRRR\(	RtHTTPSConnectionR8RR[RtCA_CERTSR	t"disable_ssl_certificate_validation(
R0R@RVRRR\RR[R	Rq((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s
				cCs�d|krPg|dD]&}|dj�dkr|d^q}|rP|Sng|dD].}|ddj�dkr[|dd^q[S(s�Returns a list of valid host globs for an SSL certificate.

        Args:
          cert: A dictionary representing an SSL certificate.
        Returns:
          list: A list of valid host globs.
        tsubjectAltNameitdnsitsubjectt
commonname(RY(R0RARPthosts((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_GetValidHostsForCert�s&cCse|j|�}xO|D]G}|jdd�jdd�}tjd|f|tj�rtSqWtS(sValidates that a given hostname is valid for an SSL certificate.

        Args:
          cert: A dictionary representing an SSL certificate.
          hostname: The hostname to test.
        Returns:
          bool: Whether or not the hostname is valid for this certificate.
        t.s\.RLs[^.]*s^%s$(RwR�R�R�tIR�R�(R0RARCRvR@thost_re((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_ValidateCertificateHostname�s	
c	Cspd}|jrT|jj�rTt}|jj�\}}}}}}|}	|}
nt}|j}	|j}
tj|	|
dtj	�}x�|D]�\}}
}}}y�|r�t
j||
|�}|j||||||�n.tj||
|�}|j
tjtjd�t|j�r0|j|j�n|j|j|jf�t||j|j|j|j�|_|jdkr�d|j|jfGH|r�dt|||||f�GHq�n|js#|jj�}|jjdd�d}|j||�s#td||f||��q#nWn(t tfk
r�}|rO|j!�n|jrh|jj!�nd
|_t#|d�r�|j$t%j&kr�t'|��qO�n�tjtj(fk
r��n�tj)k
rN}|jdkr&d	|j|jfGH|r&dt|||||f�GHq&n|jr?|jj!�nd
|_q�nXPq�W|jsltj)|�nd
S(s(Connect to a host on a given (SSL) port.s!getaddrinfo returns an empty listiisconnect: (%s, %s)s	proxy: %sR�s<Server presented certificate that does not match host %s: %sterrnosconnect fail: (%s, %s)N(*R[RAR�R@R�R@RVRR]R^RR_R`RaRbRcRRRdReRRRRqR	RR(RftgetpeercertRLR{R?tssl_SSLErrorR+RRR|R
t
SSL_ERROR_SSLR=tgaierrorRf(R0R-RgR:R;R<R=R>R?R@RVtaddress_infotfamilyRjRkRltsockaddrRRARCte((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRe�sr!			$	 
		!$			N(	R3R4R�RR�R8RwR{Re(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRn�s		 		RH(tapiproxy_stub_mapturlfetch(tfetch(tInvalidURLErrorcs%ddittd�fd�}|S(NtGETcsU|dkr!tj�pd}nt|d|d|d|d|d|d|d��S(	NitpayloadR�Rwtallow_truncatedtfollow_redirectstdeadlinetvalidate_certificate(RRtgetdefaulttimeoutR�(RPR�R�RwR�R�R�(R�(s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytfixed_fetchVs(RR�R�(R�R�((R�s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_new_fixed_fetchUs	tAppEngineHttpConnectionc	Bs/eZdZddddddded�ZRS(s�Use httplib on App Engine, but compensate for its weirdness.

        The parameters key_file, cert_file, proxy_info, ca_certs, and
        disable_ssl_certificate_validation are all dropped on the ground.
        c

	Cs)tjj||d|d|d|�dS(NRVR\R(RRZR8(
R0R@RVRRR\RR[R	Rq((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8gsN(R3R4R�RR�R8(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�as	tAppEngineHttpsConnectionc	Bs/eZdZddddddded�ZRS(s4Same as AppEngineHttpConnection, but for HTTPS URIs.c


CsEtjj||d|d|d|d|d|�t|	�|_dS(NRVRRR\R(RRoR8R�t_fetch(
R0R@RVRRR\RR[R	Rq((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8osN(R3R4R�RR�R8(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�ms	cBs�eZdZddeded�Zd�Zd�Zd�Z	dd�Z
d�Zd�Zd	�Z
d
�Zd�Zdddedd
�Zd�ZRS(s�An HTTP client that handles:

    - all methods
    - caching
    - ETags
    - compression,
    - HTTPS
    - Basic
    - Digest
    - WSSE

    and more.
    cCs�||_||_||_i|_|rKt|t�rKt|�|_n	||_t�|_	t
�|_g|_t
|_ddg|_t|_t|_t|_||_t|_dS(sIf 'cache' is a string then it is used as a directory name for
        a disk cache. Otherwise it must be an object that supports the
        same interface as FileCache.

        All timeouts are in seconds. If None is passed for timeout
        then Python's default timeout for sockets will be used. See
        for example the docs of socket.setdefaulttimeout():
        http://docs.python.org/library/socket.html#socket.setdefaulttimeout

        `proxy_info` may be:
          - a callable that takes the http scheme ('http' or 'https') and
            returns a ProxyInfo instance per request. By default, uses
            proxy_nfo_from_environment.
          - a ProxyInfo instance (static proxy config).
          - None (proxy disabled).

        ca_certs is the path of a file containing root CA certificates for SSL
        server certificate validation.  By default, a CA cert file bundled with
        httplib2 is used.

        If disable_ssl_certificate_validation is true, SSL cert validation will
        not be performed.
        tPUTtPATCHN(R[R	RqtconnectionsRet
basestringR$R�R1R�R8tcertificatestauthorizationsR�R�toptimistic_concurrency_methodsR�tfollow_all_redirectstignore_etagtforce_exception_to_status_codeRtforward_authorization_headers(R0R�RR[R	Rq((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�s"											cCsBtj|j�}d|kr(|d=nd|kr>|d=n|S(NR�R�(tcopyt__dict__(R0t
state_dict((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt__getstate__�s

cCs|jj|�i|_dS(N(R�tupdateR�(R0tstate((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt__setstate__�sc	
cstt|d�}x^|jj|�D]J}xAtD]9}|j|�r/t||||||||�Vq/q/Wq"WdS(scA generator that creates Authorization objects
           that can be applied to requests.
        swww-authenticateN(R�R�R7tAUTH_SCHEME_ORDERR|tAUTH_SCHEME_CLASSES(	R0R@R`RwR6R7t
challengestcredR[((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_auth_from_challenge�s

RFcCs|jj|||�dS(s]Add a name and password that will be used
        any time a request requires authentication.N(R�R4(R0R�R�R3((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytadd_credentials�scCs|jj|||�dS(sXAdd a key and cert that will be used
        any time a request requires authentication.N(R�R4(R0RxRAR3((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytadd_certificate�scCs|jj�g|_dS(sKRemove all the names and passwords
        that are used for authenticationN(R�R5R�(R0((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pytclear_credentials�s
cCsd}t}x�|tkr�|d7}yEt|d�rS|jdkrS|j�n|j||||�Wnotjk
r��nYtj	k
r�|j
�td|j��n)t
k
r�|j
��ntjk
rF}d}	t|d�r
t|d�d}	n	|j}	|	tjtjfkr@|tkr@qn�n�tjk
r�t|d�r�|jdkr�|tdkr�|j
�|j�qq�|j
��n|tdkr�|j
�|j�qq�nXy|j�}
Wn�tjk
rH|r8|dkr8d}t}|j
�|j�qq�|j
��n�tjtjfk
r�|tdkr�|j
�|j�qq�|j
��nVXd}|dkr�|j
�n|
j�}t|
�}
|dkr�t|
|�}nPqW|
|fS(NiiRsUnable to find the server at %stargsRFtHEAD(R�tRETRIESRRRReR�RRR�R+R<R@R~RftgetattrR|tENETUNREACHt
EADDRNOTAVAILRt
HTTPExceptiontgetresponset
BadStatusLineR�R�R R�(R0tconnR`R�RRwR�tseen_bad_status_lineR�terrR6R7((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt
_conn_request�s~




	$












c
CsEg|jD]-}
|
j||�r
|
j|�|
f^q
}|rWt|�ddpZd}
|
r||
j||||�n|j|||||�\}}
|
r�|
j||�r�|
j||||�|j|||||�\}}
d|_q�n|j	dkr�x�|j
|||||
�D]p}|j||||�|j|||||�\}}
|j	dkr&|jj|�|j||�Pq&q&Wn|js�|dks�|j	dkr;|j
r�|j	dkr�|r�|jd�r|j	dkrttd�||
��n|jd�ru|d}t|�\}}}}}|dkrutj||�|d<qun|j	dkr�|dkr�|d|d
<|jd�s�||d<nt|||
|j|	�n|jd�r�|d=n|jd�r|d=nd|kr(|jr(|d=n|jd�r�|d}tj|�}|jd�sl||d<n|}|j	dkr�d}d}n|j|d|d|d|d|d�\}}
||_q�q8td||
��q;|j	dkr;|dkr;|jd�s||d<nt|||
|j|	�q;n||
fS( smDo the actual request using the connection object
        and also follow one level of redirects if necessaryiii�R�R�i/i,i-i.i3tlocations:Redirected but the response is missing a Location: header.s-x-permanent-redirect-urlscontent-locations
if-none-matchsif-modified-sinceR�R�RRwtredirectionss3Redirected more times than rediection_limit allows.i�i�N(sGETsHEAD(i,i-i.i/i3(sGETsHEAD(i.i/(i�i�(sGETsHEAD(R�R�R�R,RR�R�R6t
_stale_digestR�R�R2R�R�R|R#R�RVRTturljoinR�R�R�R�tdeepcopytpreviousR$(R0R�R@tabsolute_uriR`R�RRwR�R�R�tauthsR6R7R�R�R[R\R]R^R_told_responsetredirect_method((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt_requestJsv= !!"!$






	
cCs
t|�S(N(Rz(R0Rw((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyRz�sR�c Cs�y�|d7kri}n|j|�}|jd�sGdt|d<nt|�}t|�\}}}	}
|jd�dd!}t|�dkr�|ddkr�|dkr�d	}|d}n|j||�}|d|}
|
|j	kr|j	|
}n|st
|}nt|jj
|��}|d	kr�|r�||d
|ddd|ddd|jd
|d|jd|j�}|j	|
<q�||d|jd
|d|jd|j�}|j	|
<n&||d|jd
|�}|j	|
<|jt�d|kr(d|kr(d|d<ntjj�}d7}|jr�|
jd�}|jj|�}|r�yM|jdd�\}}tjj�}|j|�|j�}d7|_Wq�ttfk
r�|jj|�d7}d7}q�Xq�nd7}||jkrJ|jrJ|jd�rJ|j rJd|krJ|d|d<n|d8krx|jrx|rx|jj|�n|d9krd|kr|d}|j!�j"dd�jd�}xG|D]<}d|}||}|j|d7�|kr�d7}Pq�q�Wn|r�|d:kr�|jr�d|kr�|jd�r�|dkr\t#did��n|j$|dd dd!|d"|d�\}}t%|�|_&t'|j&_(n	t)||�}|d#kr|s�d$|d%<d}nt%|�}|r�t'|_(n||fS|d&krv|jd�rG|j rGd'|krG|d|d'<n|jd(�r�d(|kr�|d(|d)<q�n|d*kr�n|j*||||	|||||�	\}}|j+d+krP|dkrPx"t,|�D]}||||<q�Wt%|�}t-|d,�r|j.|_.nt/||||j|�|}d-|_+t'|_(q�|j+d-krh|}q�|jj|�|}ngt0|�}|jd.�r�d$|d%<t%|�}d}n-|j*||||	|||||�	\}}Wn�t1k
r�}|j2r�t3|t4�r@|j5}|j6}d/|_+t7|�|_8q�t3|t9j�r�d0}t%id1d26d3d%6t|�d46�}d0|_8q�t7|�}t%id1d26d5d%6t|�d46�}d6|_8q��nX||fS(;sd Performs a single HTTP request.

        The 'uri' is the URI of the HTTP resource and can begin with either
        'http' or 'https'. The value of 'uri' must be an absolute URI.

        The 'method' is the HTTP method to perform, such as GET, POST, DELETE,
        etc. There is no restriction on the methods allowed.

        The 'body' is the entity body to be sent with the request. It is a
        string object.

        Any extra headers that are to be sent with the request should be
        provided in the 'headers' dictionary.

        The maximum number of redirect to follow before raising an
        exception is 'redirections. The default is 5.

        The return value is a tuple of (response, content), the first
        being and instance of the 'Response' class, the second being
        a string that contains the response entity body.
        s
user-agentsPython-httplib2/%s (gzip)R�iiit443R�RHRRRR[R	RqR�saccept-encodings
gzip, deflatesutf-8s

tetagsif-matchR�R�R�RsRFRGs
-varied-%ss-x-permanent-redirect-urls3Redirected more times than rediection_limit allows.R�RwR�R�t504R�R�s
if-none-matchs
last-modifiedsif-modified-sinceR�i0R�i�sonly-if-cachedi�sRequest Timeouts
text/plainscontent-typet408scontent-lengtht400sBad RequestN(sGETsHEAD(sGETsHEAD(sGETsHEAD(:RRzR|t__version__RRbRLRot_get_proxy_infoR�tSCHEME_TO_CONNECTIONRHR�R7RR	Rqtset_debuglevelR(R�R�R�RhRKt
FeedParsertfeedR+t_parset
IndexErrorR�R�R�R�RYR�R$R�R R�R�t	fromcacheR�R�R�RRRR�R�R�t	ExceptionR�ReR5R6R7RfRR( R0RR�RRwR�tconnection_typeR[R\R`Ratdomain_portR[tconn_keyR�tcertsR�tcached_valueR�R7t
feedparserR�R�RQRxRyR6R�tentry_dispositiontmerged_responseR�R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR��s	.

		

	

=
!


'

	
%-			
	1				cCsetj|�\}}|j}t|�r9||�}nt|d�ra|j|�rad}n|S(sYReturn a ProxyInfo instance (or None) based on the scheme
        and authority.
        RDN(Rt	splitportR[tcallableRRDR(R0R[R\RCRVR[((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�ss		N(R3R4R�RRRR�R8R�R�R�R�R�R�R�R�RztDEFAULT_MAX_REDIRECTSR�R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR�s
C	
		
			M	J	�cBs>eZdZeZdZdZdZdZ	d�Z
d�ZRS(s<An object more like email.Message than httplib.HTTPResponse.ii�tOkcCs8t|tj�ryx*|j�D]\}}|||j�<qW|j|_t|j�|d<|j|_|j|_n�t|t	j
j
�r�x*|j�D]\}}|||j�<q�Wt|d�|_ncx*|j
�D]\}}|||j�<q�Wt|jd|j��|_|jd|j�|_dS(NR�R(ReRtHTTPResponseR2RYR�RfRtversionR�R�R/R�RuRK(R0R�RxRy((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR8�scCs|dkr|St|�dS(NRt(tAttributeError(R0R�((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt__getattr__�sN(R3R4R�R�R�R�R�RRR�R8R�(((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyR �s	(�t
__future__RRt
__copyright__t__contributors__t__license__R�R�tsysR�temail.Utilst
email.Messagetemail.FeedParserR�R�R�RRTRR�R&R�R�R�R�R|thashlibRR�RRktImportErrortshaRR
RR�Rthttplib2RR�RR
tSSLErrorR~Rtversion_infoRRt__all__R(R�R,R1RR�R2R�R"R5R#R$R%R&R'R:R;R<R)RR=R>R?R�tca_certs_locaterRKRpRIRRtcompileRSRVRbRdRnRrRvRzR�R�R�R�R�R�R�R�R�R�R�tobjectR�R�R�R�RRR�R�R$R1R8R9R!RRRNRZRYRoRnR�tgoogle.appengine.apiR�tapiproxytGetStubtgoogle.appengine.api.urlfetchR�R�tgoogle3.apphosting.apitgoogle3.apphosting.api.urlfetchR�R�R�RRtR (((s5/usr/lib/python2.7/site-packages/httplib2/__init__.pyt<module>sD	
	

	

			

						
 	J		%		"
:<
!9(B�
			
��