a 97al ã@spdZddlmZmZmZddlmZGdd„deƒZGdd„deƒZGdd „d eƒZ Gd d „d eƒZ [[[[d S) aResponse classes used by urllib. The base class, addbase, defines a minimal file-like interface, including read() and readline(). The typical response object is an addinfourl instance, which defines an info() method that returns headers and a geturl() method that returns the url. é)Úabsolute_importÚdivisionÚunicode_literals)Úobjectc@s@eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dS)Úaddbasez(Base class for addinfo and addclosehook.cCsV||_|jj|_|jj|_t|jdƒr0|jj|_t|jdƒrH|jj|_n dd„|_dS)NÚ readlinesÚfilenocSsdS©N©r r r ú{/private/var/folders/s6/9n5zrl012gv99k63s4q6ccsd4s6mqz/T/pip-target-f5cq3f2q/lib/python/future/backports/urllib/response.pyÚóz"addbase.__init__..)ÚfpÚreadÚreadlineÚhasattrrr)Úselfrr r r Ú__init__s      zaddbase.__init__cCs t|jƒSr )Úiterr©rr r r Ú__iter__szaddbase.__iter__cCsd|jjt|ƒ|jfS)Nz<%s at %r whose fp = %r>)Ú __class__Ú__name__Úidrrr r r Ú__repr__%s ÿzaddbase.__repr__cCs>|jr|j ¡d|_d|_d|_d|_d|_d|_d|_dSr )rÚcloserrrrrÚ__next__rr r r r)s z addbase.closecCs|jdurtdƒ‚|S)NzI/O operation on closed file)rÚ ValueErrorrr r r Ú __enter__4s zaddbase.__enter__cCs | ¡dSr )r)rÚtypeÚvalueÚ tracebackr r r Ú__exit__9szaddbase.__exit__N) rÚ __module__Ú __qualname__Ú__doc__rrrrrr"r r r r r s  rc@s eZdZdZdd„Zdd„ZdS)Ú addclosehookz*Class to add a close hook to an open file.cGst ||¡||_||_dSr )rrÚ closehookÚhookargs)rrr'r(r r r r?s zaddclosehook.__init__cCs,|jr|j|jŽd|_d|_t |¡dSr )r'r(rrrr r r rDs  zaddclosehook.closeN)rr#r$r%rrr r r r r&<sr&c@s eZdZdZdd„Zdd„ZdS)Úaddinfoz.class to add an info() method to an open file.cCst ||¡||_dSr )rrÚheaders)rrr*r r r rNs zaddinfo.__init__cCs|jSr ©r*rr r r ÚinfoRsz addinfo.infoN)rr#r$r%rr,r r r r r)Ksr)c@s2eZdZdZd dd„Zdd„Zdd„Zd d „ZdS) Ú addinfourlz9class to add info() and geturl() methods to an open file.NcCs"t ||¡||_||_||_dSr )rrr*ÚurlÚcode)rrr*r.r/r r r rXs zaddinfourl.__init__cCs|jSr r+rr r r r,^szaddinfourl.infocCs|jSr )r/rr r r Úgetcodeaszaddinfourl.getcodecCs|jSr )r.rr r r Úgeturldszaddinfourl.geturl)N)rr#r$r%rr,r0r1r r r r r-Us  r-N) r%Ú __future__rrrZfuture.builtinsrrr&r)r-r r r r Ús 1