grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B ëä³+Ó4õã @s´ddlZddlZdddddddd d d d d g Zdad dd„Zdd„Zdd„Zdd„Zdd„Zdd„Z dd„Z dd „Z dd „Z Gdd „d ƒZ dd „Zd!dd „Zdd„Zedkr°eƒdS)"éNÚinputÚcloseÚnextfileÚfilenameÚlinenoÚ filelinenoÚfilenoÚ isfirstlineÚisstdinÚ FileInputÚhook_compressedÚ hook_encodedFÚÚrcCs(trtjrtdƒ‚t||||||ƒatS)Nzinput() already active)Ú_stateÚ_fileÚ RuntimeErrorr )ÚfilesÚinplaceÚbackupÚbufsizeÚmodeÚopenhook©rú./opt/alt/python37/lib64/python3.7/fileinput.pyrSs cCst}da|r| ¡dS)N)rr)ÚstaterrrrascCsts tdƒ‚t ¡S)Nzno active input())rrrrrrrris cCsts tdƒ‚t ¡S)Nzno active input())rrrrrrrrwscCsts tdƒ‚t ¡S)Nzno active input())rrrrrrrr€scCsts tdƒ‚t ¡S)Nzno active input())rrrrrrrrŠscCsts tdƒ‚t ¡S)Nzno active input())rrrrrrrr”scCsts tdƒ‚t ¡S)Nzno active input())rrr rrrrr �scCsts tdƒ‚t ¡S)Nzno active input())rrr rrrrr ¦sc@s–eZdZd(dd„Zdd „Zd d „Zd d „Zdd„Zdd„Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„ZdS))r NFrrrcCst|tƒr|f}nBt|tjƒr,t |¡f}n(|dkrBtjdd…}|sLd}nt|ƒ}||_||_ ||_ |r‚ddl }|j dt dd�d|_d|_d|_d|_d|_d|_d|_d|_|dkrÂtd ƒ‚d |kràddl }|  d t d¡||_|�r |røtd ƒ‚t|ƒ�s td ƒ‚||_dS)Né)ú-rz!bufsize is deprecated and ignoredé)Ú stacklevelF)rZrUÚUÚrbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'r z'U' mode is deprecatedz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)Ú isinstanceÚstrÚosÚPathLikeÚfspathÚsysÚargvÚtupleÚ_filesÚ_inplaceÚ_backupÚwarningsÚwarnÚDeprecationWarningÚ _savestdoutÚ_outputÚ _filenameÚ _startlinenoÚ _filelinenorÚ_isstdinÚ_backupfilenameÚ ValueErrorÚ_modeÚcallableÚ _openhook)Úselfrrrrrrr-rrrÚ__init__¼sJ    zFileInput.__init__cCs | ¡dS)N)r)r;rrrÚ__del__èszFileInput.__del__cCsz | ¡Wdd|_XdS)Nr)rr*)r;rrrrës zFileInput.closecCs|S)Nr)r;rrrÚ __enter__ñszFileInput.__enter__cCs | ¡dS)N)r)r;ÚtypeÚvalueÚ tracebackrrrÚ__exit__ôszFileInput.__exit__cCs|S)Nr)r;rrrÚ__iter__÷szFileInput.__iter__cCs:x4| ¡}|r |jd7_|S|js*t‚| ¡qWdS)Nr)Ú _readliner4rÚ StopIterationr)r;ÚlinerrrÚ__next__úszFileInput.__next__cCs>|| ¡krtdƒ‚y| ¡Stk r8tdƒ‚YnXdS)Nzaccessing lines out of orderzend of input reached)rrrGrEÚ IndexError)r;ÚirrrÚ __getitem__s  zFileInput.__getitem__cCs¾|j}d|_|r|t_|j}d|_z|r0| ¡Wd|j}d|_y|`Wntk r\YnXz|rr|jsr| ¡Wd|j }d|_ |r°|j s°yt   |¡Wnt k r®YnXd|_XXdS)NF)r0r'Ústdoutr1rrrDÚAttributeErrorr5r6r,r$ÚunlinkÚOSError)r;Z savestdoutÚoutputÚfileZbackupfilenamerrrr s4    zFileInput.nextfilecCs:x4| ¡}|r |jd7_|S|js*|S| ¡qWdS)Nr)rDr4rr)r;rFrrrÚreadline+szFileInput.readlinecCs|jsd|jkrdSdS|jd|_|jdd…|_| ¡|_d|_d|_d|_d|_|jdkr–d|_d|jkr„t t j d t j ƒ|_nt j |_d |_�n\|j �rÆt  |j¡|jp°d |_yt  |j¡Wntk rÚYnXt  |j|j¡t|j|jƒ|_yt  |j ¡¡j}Wn$tk �r6t|jd ƒ|_Yn~Xt jt jBt jB}tt d ƒ�r`|t jO}t  |j||¡}t  |d ¡|_ytt dƒ�ršt  |j|¡Wntk �r²YnXt j|_ |jt _n,|j!�râ| !|j|j¡|_nt|j|jƒ|_|jj"|_#| #¡S)NÚbórrrFrzÚbufferTz.bakÚwÚO_BINARYÚchmod)$r*r8r2rr3r4rr5r6Úgetattrr'Ústdinr+r$r&r,rMrNÚrenameÚopenÚfstatrÚst_moder1ÚO_CREATÚO_WRONLYÚO_TRUNCÚhasattrrVÚfdopenrWrKr0r:rQrD)r;ZpermrÚfdrrrrD6s\           zFileInput._readlinecCs|jS)N)r2)r;rrrrpszFileInput.filenamecCs |j|jS)N)r3r4)r;rrrrsszFileInput.linenocCs|jS)N)r4)r;rrrrvszFileInput.filelinenocCs0|jr(y |j ¡Stk r$dSXndSdS)Néÿÿÿÿ)rrr7)r;rrrrys  zFileInput.filenocCs |jdkS)Nr)r4)r;rrrr ‚szFileInput.isfirstlinecCs|jS)N)r5)r;rrrr …szFileInput.isstdin)NFrrrN)Ú__name__Ú __module__Ú __qualname__r<r=rr>rBrCrGrJrrQrDrrrrr r rrrrr ¯s$  +  : cCsVtj |¡d}|dkr,ddl}| ||¡S|dkrHddl}| ||¡St||ƒSdS)Nrz.gzrz.bz2)r$ÚpathÚsplitextÚgzipr[Úbz2ZBZ2File)rrZextrjrkrrrr ‰s  cs‡‡fdd„}|S)Ncst||ˆˆd�S)N)ÚencodingÚerrors)r[)rr)rlrmrrr–szhook_encoded..openhookr)rlrmrr)rlrmrr •scCsæddl}d}d}| tjdd…d¡\}}x(|D] \}}|dkrDd}|dkr0|}q0Wxtt|||d�D]b}|d d…d kr„|dd …}|d d…d kr |dd …}td tƒtƒtƒtƒrºd p¼d|fƒqdWtdtƒtƒtƒfƒdS)NrFrzib:z-iTz-b)rrrdÚ ú z%d: %s[%d]%s %sÚ*rz %d: %s[%d]) Úgetoptr'r(rÚprintrrrr )rqrrZoptsÚargsÚoÚarFrrrÚ_test›s"  rvÚ__main__)NFrrrN)N)r'r$Ú__all__rrrrrrrrr r r r r rvrerrrrÚKs*         [