/usr/lib/python2.6/site-packages/urllib3
NameSizeModeActions
contrib/-0755rm
packages/-0755rm
util/-0755rm
connection.py89670644editdlrm
connection.pyc80210644editdlrm
connectionpool.py304140644editdlrm
connectionpool.pyc244930644editdlrm
exceptions.py41090644editdlrm
exceptions.pyc81230644editdlrm
fields.py58330644editdlrm
fields.pyc65580644editdlrm
filepost.py22810644editdlrm
filepost.pyc31820644editdlrm
poolmanager.py94160644editdlrm
poolmanager.pyc98810644editdlrm
request.py59320644editdlrm
request.pyc59990644editdlrm
response.py171490644editdlrm
response.pyc158390644editdlrm
_collections.py105200644editdlrm
_collections.pyc128410644editdlrm
__init__.py18640644editdlrm
__init__.pyc25910644editdlrm
Edit: /usr/lib/python2.6/site-packages/urllib3/response.pyc (15839B)
Ñò ;vVc @sddklZddkZddkZddklZddklZddk l Z l Z l Z l Z ddklZlZlZddklZdd klZlZdd klZlZd efd „ƒYZd efd„ƒYZd„Zdei fd„ƒYZ!dS(iÿÿÿÿ(tcontextmanagerN(ttimeouti(tHTTPHeaderDict(t ProtocolErrort DecodeErrortReadTimeoutErrortResponseNotChunked(t string_typest binary_typetPY3(t http_client(t HTTPExceptiont BaseSSLError(t is_fp_closedtis_response_to_headtDeflateDecodercBs#eZd„Zd„Zd„ZRS(cCs(t|_tƒ|_tiƒ|_dS(N(tTruet _first_tryRt_datatzlibt decompressobjt_obj(tself((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt__init__s  cCst|i|ƒS(N(tgetattrR(Rtname((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt __getattr__scCs§|p|S|ip|ii|ƒS|i|7_y|ii|ƒSWnVtij oGt|_titi ƒ|_z|i|iƒSWdd|_XnXdS(N( RRt decompressRRterrortFalseRt MAX_WBITStNone(Rtdata((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRs  (t__name__t __module__RRR(((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRs  t GzipDecodercBs#eZd„Zd„Zd„ZRS(cCstidtiƒ|_dS(Ni(RRRR(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR/scCst|i|ƒS(N(RR(RR((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR2scCs|p|S|ii|ƒS(N(RR(RR ((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR5s(R!R"RRR(((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR#-s  cCs|djotƒStƒS(Ntgzip(R#R(tmode((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt _get_decoder;s t HTTPResponsec BsFeZdZddgZdddddgZdd"d d d"d eed"d"d"d „ Zd „Zd „Z e d „ƒZ d„Z d„Z d„Zed„ƒZd"d"ed„Zd#d"d„Zed„ƒZd„Zd"d„Zd„Ze d„ƒZd„Zd„Zd„Zd„Zd„Zd „Zd"d"d!„Z RS($sÅ HTTP Response container. Backwards-compatible to httplib's HTTPResponse but the response ``body`` is loaded and decoded on-demand when the ``data`` property is accessed. This class is also compatible with the Python standard library's :mod:`io` module, and can hence be treated as a readable object in the context of that framework. Extra parameters for behaviour not present in httplib.HTTPResponse: :param preload_content: If True, the response's body will be preloaded during construction. :param decode_content: If True, attempts to decode specific content-encoding's based on headers (like 'gzip' and 'deflate') will be skipped and raw data will be used instead. :param original_response: When this HTTPResponse wrapper is generated from an httplib.HTTPResponse object, it's convenient to include the original for debug purposes. It's otherwise unused. R$tdeflatei-i.i/i3i4tic Csyt|tƒo ||_nt|ƒ|_||_||_||_||_||_d|_ d|_ d|_ | |_ d|_ |o#t|ttfƒo ||_ n| |_| |_t|dƒo ||_ nt|_d|_|iiddƒiƒ} d„| idƒDƒ} d| jo t|_n|i o+|o$|i o|id|ƒ|_ ndS( Nitreadstransfer-encodingR)cssx|]}|iƒVqWdS(N(tstrip(t.0tenc((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pys s t,tchunkedtdecode_content(t isinstanceRtheaderststatustversiontreasontstrictR0Rt_decodert_bodyt_fpt_original_responset_fp_bytes_readt basestringRt_poolt _connectionthasattrRR/t chunk_lefttgettlowertsplitRR*(RtbodyR2R3R4R5R6tpreload_contentR0toriginal_responsetpoolt connectionttr_enct encodings((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR_s6                   cCs(|i|ijo|iidƒStS(s Should we redirect and where to? :returns: Truthy redirect location string if we got a redirect status code and valid location. ``None`` if redirect status and no location. ``False`` if not a redirect status code. tlocation(R3tREDIRECT_STATUSESR2RAR(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pytget_redirect_location‰scCs;|i p |i odS|ii|iƒd|_dS(N(R=R>t _put_connR(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt release_conn–scCs1|io|iS|io|idtƒSdS(Nt cache_content(R8R9R*R(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR s  cCs|iS(sÛ Obtain the number of bytes pulled over the wire so far. May differ from the amount of content returned by :meth:``HTTPResponse.read`` if bytes are encoded on the wire (e.g, compressed). (R;(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyttell¦scCsR|iiddƒiƒ}|idjo#||ijot|ƒ|_ndS(s< Set-up the _decoder attribute if necessar. scontent-encodingR)N(R2RARBR7RtCONTENT_DECODERSR&(Rtcontent_encoding((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt _init_decoder®s cCsÆy+|o |io|ii|ƒ}nWnLttifj o7}|iiddƒiƒ}td||ƒ‚nX|oA|o:|io0|iit ƒƒ}|||ii ƒ7}n|S(sN Decode the data passed in and potentially flush the decoder. scontent-encodingR)sEReceived response with content-encoding: %s, but failed to decode it.( R7RtIOErrorRRR2RARBRRtflush(RR R0t flush_decoderteRStbuf((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt_decode¸sc cszëy¢y dVWn’tj ot|iddƒ‚nltj o8}dt|ƒjo‚nt|iddƒ‚n)tj o}td||ƒ‚nXWnBtj o6|i o"|i i ƒ o|i i ƒn‚nXWd|i o|i i ƒo|i ƒnXdS(sç Catch low-level python exceptions, instead re-raising urllib3 variants, so that low-level exceptions are not leaked in the high-level api. On exit, release the connection back to the pool. NsRead timed out.sread operation timed outsConnection broken: %r( t SocketTimeoutRR=RR tstrR Rt ExceptionR:tisclosedtcloseRO(RRX((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt_error_catcherËs$   cCs|iƒ|djo |i}n|idjodSt}d}|iƒiiƒzn|djo|iiƒ}t }nEt}|ii|ƒ}|djo| o|ii ƒt }nWdQX|oB|i t |ƒ7_ |i |||ƒ}|o ||_qn|S(sP Similar to :meth:`httplib.HTTPResponse.read`, but with two additional parameters: ``decode_content`` and ``cache_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full response. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param cache_content: If True, will save the returned data such that the same result is returned despite of the state of the underlying file object. This is useful if you want the ``.data`` property to continue working after having ``.read()`` the file object. (Overridden if ``amt`` is set.) Ni(RTRR0R9RR`t__exit__t __enter__R*RR_R;tlenRZR8(RtamtR0RPRWR ((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR*ôs,      iiccsw|io)xf|i|d|ƒD] }|Vq WnAx=t|iƒp,|id|d|ƒ}|o |Vq6q6WdS(s_ A generator wrapper for the read() method. A call will block until ``amt`` bytes have been read from the connection or until the connection is closed. :param amt: How much of the content to read. The generator will return up to much data per iteration, but may return less. This is particularly likely when using compressed data. However, the empty string will never be returned. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. R0RdN(R/t read_chunkedR R9R*(RRdR0tlineR ((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pytstream1s  cKsž|i}t|tƒp0tot|iƒƒ}qIti|ƒ}nt|ddƒ}|d|d|d|id|id|i d|d||}|S( s  Given an :class:`httplib.HTTPResponse` instance ``r``, return a corresponding :class:`urllib3.response.HTTPResponse` object. Remaining parameters are passed to the HTTPResponse constructor, along with ``original_response=r``. R6iRDR2R3R4R5RF( tmsgR1RR titemst from_httplibRR3R4R5(t ResponseClstrt response_kwR2R6tresp((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRjKs      cCs|iS(N(R2(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt getheadersiscCs|ii||ƒS(N(R2RA(RRtdefault((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt getheaderlscCs|ip|iiƒndS(N(tclosedR9R_(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR_ps cCs\|idjotSt|idƒo |iiSt|idƒo|iiƒStSdS(NRrR^(R9RRR?RrR^(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRrts cCsQ|idjotdƒ‚n.t|idƒo|iiƒStdƒ‚dS(Ns-HTTPResponse has no file to get a fileno fromtfilenosOThe file-like object this HTTPResponse is wrapped around has no file descriptor(R9RRUR?Rs(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRss cCs5|idj o!t|idƒo|iiƒSdS(NRV(R9RR?RV(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRVˆs#cCstS(N(R(R((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pytreadableŒscCsK|it|ƒƒ}t|ƒdjodS||t|ƒ*t|ƒSdS(Ni(R*Rc(Rtbttemp((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pytreadintos cCs†|idj odS|iiiƒ}|iddƒd}yt|dƒ|_Wn,tj o |iƒt i |ƒ‚nXdS(Nt;iii( R@RR9tfptreadlineRCtintt ValueErrorR_thttplibtIncompleteRead(RRf((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt_update_chunk_length™s cCsþd}|djo8|ii|iƒ}|}|iidƒd|_n°||ijo,|ii|ƒ}|i||_|}nt||ijo5|ii|ƒ}|iidƒd|_|}n/|ii|iƒ}|iidƒd|_|S(Ni(RR9t _safe_readR@(RRdtreturned_chunktchunktvalue((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyt _handle_chunk§s&      c cs#|iƒ|iptdƒ‚n|io"t|iƒo|iiƒdS|iƒiiƒzµxTt oL|i ƒ|i djoPn|i |ƒ}|i |d|dt ƒVqkWx<t o4|iiiƒ}|pPn|djoPqÂqÂW|io|iiƒnWdQXdS(sþ Similar to :meth:`HTTPResponse.read`, but with an additional parameter: ``decode_content``. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. sHResponse is not chunked. Header 'transfer-encoding: chunked' is missing.NiR0RWs (RTR/RR:RR_R`RaRbRRR@R„RZR9RyRz(RRdR0R‚Rf((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyRe½s0        Ni(!R!R"t__doc__RRRLRRRRMROtpropertyR RQRTRZRR`RR*Rgt classmethodRjRoRqR_RrRsRVRtRwRR„Re(((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyR'Bs6  (   )=       ("t contextlibRRtiotsocketRR[t _collectionsRt exceptionsRRRRt packages.sixRR<RR tpackages.six.movesR R}RHR R t util.responseR RtobjectRR#R&tIOBaseR'(((s1/tmp/pip-build-cD3xZi/urllib3/urllib3/response.pyts  "