/usr/lib/python3/dist-packages/debian/__pycache__
NameSizeModeActions
arfile.cpython-310.pyc100240644editdlrm
changelog.cpython-310.pyc275540644editdlrm
copyright.cpython-310.pyc210830644editdlrm
deb822.cpython-310.pyc755650644editdlrm
debfile.cpython-310.pyc132180644editdlrm
debian_support.cpython-310.pyc202770644editdlrm
debtags.cpython-310.pyc141890644editdlrm
deprecation.cpython-310.pyc10280644editdlrm
watch.cpython-310.pyc64780644editdlrm
_util.cpython-310.pyc111970644editdlrm
_version.cpython-310.pyc2150644editdlrm
__init__.cpython-310.pyc8080644editdlrm
Edit: /usr/lib/python3/dist-packages/debian/__pycache__/arfile.cpython-310.pyc (10024B)
o …Úãa³5ã@s¾dZddlZzddlmZmZmZmZmZmZm Z m Z m Z Wn e y'YnwdZ ee ƒZdZdZGdd„deƒZGd d „d eƒZGd d „d eƒZed kr]edƒZed e ¡¡ƒdSdS)zÌ Representation of ar archives for use with Debian binary packages These classes are primarily intended to be used with the :class:`debian.debfile.DebFile` class for working with Debian binary packages. éN) ÚAnyÚBinaryIOÚDictÚ GeneratorÚIOÚIteratorÚListÚNoReturnÚOptionals! é<s` c@seZdZdZdS)ÚArErrorz@ Common base for all exceptions raised within the arfile module N)Ú__name__Ú __module__Ú __qualname__Ú__doc__©rrú//usr/lib/python3/dist-packages/debian/arfile.pyr 3sr c@s|eZdZdZ     ddd„Zdd„Zdd „Zd d „Zd d „Ze eƒZ dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)ÚArFilea Representation of an ar archive, see man 1 ar. The interface of this class tries to mimic that of the TarFile module in the standard library. ArFile objects have the following (read-only) properties: - members same as getmembers() NÚrcCsPg|_i|_||_||_|pt ¡|_|durd}||_|dkr&| ¡dSdS)aŠ Build an ar file representation starting from either a filename or an existing file object. The only supported mode is 'r'. The encoding and errors parameters control how member names are decoded into Unicode strings. Like tarfile, the default encoding is sys.getfilesystemencoding() and the default error handling scheme is 'surrogateescape'. NÚsurrogateescaper) Ú_ArFile__membersÚ_ArFile__members_dictÚ_ArFile__fnameÚ_ArFile__fileobjÚsysÚgetfilesystemencodingÚ_ArFile__encodingÚ_ArFile__errorsÚ_ArFile__index_archive)ÚselfÚfilenameÚmodeÚfileobjÚencodingÚerrorsrrrÚ__init__As ÿzArFile.__init__cCs`|jr!t|jdƒ}| |¡WdƒdS1swYdS|jr,| |j¡dStdƒ‚)NÚrbzUnable to open valid file)rÚopenÚ_ArFile__collect_membersrr )rÚfprrrÚ__index_archive^s "ÿzArFile.__index_archivecCs‚| t¡tkr tdƒ‚ tj||j|j|jd}|sdS|j   |¡||j |j <|j ddkr7| |j d¡n | |j dd¡q )NzUnable to find global headerT)r#r$éré)ÚreadÚGLOBAL_HEADER_LENGTHÚ GLOBAL_HEADERr ÚArMemberÚ from_filerrrrÚappendrÚnameÚsizeÚseek)rr)Ú newmemberrrrÚ__collect_membershs þ  õzArFile.__collect_memberscCs |j|S)a Return the (last occurrence of a) member in the archive whose name is 'name'. Raise KeyError if no member matches the given name. Note that in case of name collisions the only way to retrieve all members matching a given name is to use getmembers. )r©rr3rrrÚ getmemberzs zArFile.getmembercCó|jS)zø Return a list of all members contained in the archive. The list has the same order of members in the archive and can contain duplicate members (i.e. members with the same name) if they are duplicate in the archive itself. ©r©rrrrÚ getmembers„szArFile.getmemberscCsdd„|jDƒS)z3 Return a list of all member names in the archive. cSsg|]}|j‘qSr)r3)Ú.0ÚfrrrÚ ”sz#ArFile.getnames..r;r<rrrÚgetnamesszArFile.getnamescCót‚©z Not (yet) implemented. ©ÚNotImplementedErrorr<rrrÚ extractall–ózArFile.extractallcCrBrCrD)rÚmemberÚpathrrrÚextractœrGzArFile.extractcCs@|jD]}t|tƒr|j|jkr|S||jkr|SqdS)z  Return a file object corresponding to the requested member. A member can be specified either as a string (its name) or as a ArMember instance. N)rÚ isinstancer0r3)rrHÚmrrrÚ extractfile¢s  ÿzArFile.extractfilecCs t|jƒS)z5 Iterate over the members of the present ar archive. )Úiterrr<rrrÚ__iter__¹ó zArFile.__iter__cCs | |¡S)z Same as .getmember(name). )r9r8rrrÚ __getitem__¿rPzArFile.__getitem__)NrNNN)r rrrr%rr(r9r=ÚpropertyÚmembersrArFrJrMrOrQrrrrr7s&  û    rc@sÎeZdZdZdd„Ze  d"dd„ƒZd#dd „Zd$d d „Zd#d d „Z d#dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zedd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZed d„ƒZed!d„ƒZdS)%r0a¾ Member of an ar archive. Implements most of a file object interface: read, readline, next, readlines, seek, tell, close. ArMember objects have the following (read-only) properties: - name member name in an ar archive - mtime modification time - owner owner user - group owner group - fmode file permissions - size size in bytes - fname file namecCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS)NÚr) Ú_ArMember__nameÚ_ArMember__mtimeÚ_ArMember__ownerÚ_ArMember__groupÚ_ArMember__fmodeÚ_ArMember__sizeÚ_ArMember__fnameÚ _ArMember__fpÚ_ArMember__offsetÚ_ArMember__endÚ_ArMember__curr<rrrr%Õs zArMember.__init__NcCs| t¡}|s dSt|ƒtkrtdƒ‚|dd…tkrtdƒ‚|dur't ¡}|dur-d}tƒ}|dd… d ¡d  ¡}|  ||¡|_ t |dd …ƒ|_ t |d d …ƒ|_t |d d …ƒ|_|d d …|_t |d d…ƒ|_||_|sw||_| ¡|_|j|j|_|j|_|S)zŒfp is an open File object positioned on a valid file header inside an ar archive. Return a new ArMember on success, None otherwise. NzIncorrect header lengthé:r zIncorrect file magicrréó/éé"é(é0)r-ÚFILE_HEADER_LENGTHÚlenÚIOErrorÚ FILE_MAGICrrr0ÚsplitÚstripÚdecoderUÚintrVrWrXrYrZr[r\Útellr]r^r_)r)Úfnamer#r$Úbufr?r3rrrr1îs4    zArMember.from_filercCs´|jdur|jdurtdƒ‚t|jdƒ|_|j |j¡d|kr*|j|jkr:nn|j |¡}|j ¡|_|S|j|jksF|j|j krHdS|j |j|j¡}|j ¡|_|S)Nú'Cannot have both fp and fname undefinedr&ró) r\r[Ú ValueErrorr'r5r_r^r-ror]©rr4rqrrrr-,s      z ArMember.readcCs–|jdur|jdurtdƒ‚t|jdƒ|_|j |j¡|dur6|j |¡}|j ¡|_|j|jkr4dS|S|j ¡}|j ¡|_|j|jkrIdS|S)Nrrr&rs) r\r[rtr'r5r_Úreadlineror^rurrrrv@s        zArMember.readlinecCs(d}g} | ¡}|s |S| |¡q©N)rvr2)rÚsizehintrqÚlinesrrrÚ readlinesVs þüzArMember.readlinescCs„|j|jkr |j|_|dkr||j|jkrtd|ƒ‚|dkr(|j||_dS|dkr4|j||_dS|dkr@|j||_dSdS)Nr+zCan't seek at %dr,r)r_r]rir^)rÚoffsetÚwhencerrrr5cs  ÿz ArMember.seekcCs|j|jkrdS|j|jS)Nr)r_r]r<rrrrors  z ArMember.tellcCsdS)NTrr<rrrÚseekablexszArMember.seekablecCs0|jdur|jdur|j ¡d|_dSdSdSrw)r\r[Úcloser<rrrr~}s  þzArMember.closecCs| ¡Srw©rvr<rrrÚnextƒsz ArMember.nextcs‡fdd„}t|ƒƒS)Nc3sˆ ¡}|r |VdSdSrwr)Úliner<rrÚnextline‰s € ÿz#ArMember.__iter__..nextline)rN)rr‚rr<rrO‡s  zArMember.__iter__cCr:rw)rUr<rrrÚ‘ózArMember.cCr:rw)rVr<rrrrƒ’r„cCr:rw)rWr<rrrrƒ“r„cCr:rw)rXr<rrrrƒ”r„cCr:rw)rYr<rrrrƒ•r„cCr:rw)rZr<rrrrƒ–r„cCr:rw)r[r<rrrrƒ—r„)NN)rrw)r rrrr%Ú staticmethodr1r-rvrzr5ror}r~r€rOrRr3ÚmtimeÚownerÚgroupÚfmoder4rprrrrr0Æs. ý =        r0Ú__main__ztest.arÚ )rrÚtypingrrrrrrrr r Ú ImportErrorr/rhr.rgrjÚ Exceptionr Úobjectrr0r ÚaÚprintÚjoinrArrrrÚs(0 þUü