grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j:@ã@sÎ ddlZddlZddlZddlmZgd¢Zdad$dddddœdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„ZGdd„dƒZdddœdd„Zd%dd „Zd!d"„Zed#kreeƒdSdS)&éN)Ú GenericAlias) ÚinputÚcloseÚnextfileÚfilenameÚlinenoÚ filelinenoÚfilenoÚ isfirstlineÚisstdinÚ FileInputÚhook_compressedÚ hook_encodedFÚÚr©ÚmodeÚopenhookÚencodingÚerrorsc Cs. tr tjr tdƒ‚t|||||||d�atS)Nzinput() already activer)Ú_stateÚ_fileÚ RuntimeErrorr )ÚfilesÚinplaceÚbackuprrrr©rú0/opt/alt/python310/lib64/python3.10/fileinput.pyrNs  ÿrcCs t}da|r | ¡dSdS©N)rr)Ústaterrrr]s  ÿrcCó tstdƒ‚t ¡S©Nzno active input())rrrrrrrres rcCr r!)rrrrrrrrsórcCr r!)rrrrrrrr|órcCr r!)rrrrrrrr†r#rcCr r!)rrr rrrrr �r"r cCr r!)rrr rrrrr ™r"r cCr r!)rrr rrrrr ¢r"r c@s¬eZdZ d(dddddœ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'„ZeeƒZdS))r NFrrrc CsPt|tƒr |f}n!t|tjƒrt |¡f}n|dur!tjdd…}|s&d}nt|ƒ}||_||_ ||_ d|_ d|_ d|_ d|_d|_d|_d|_d|_||_||_tjjrld|vrl|durl|durlddl}| dtd¡|dvrttd ƒ‚d |vrƒddl}| d td¡||_d |vr�| d d ¡nd |_|r£|r›tdƒ‚t|ƒs£tdƒ‚||_ dS)Né)ú-rFÚbz"'encoding' argument not specified.é)rZrUÚUÚrbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'r(z'U' mode is deprecatedrÚwz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)!Ú isinstanceÚstrÚosÚPathLikeÚfspathÚsysÚargvÚtupleÚ_filesÚ_inplaceÚ_backupÚ _savestdoutÚ_outputÚ _filenameÚ _startlinenoÚ _filelinenorÚ_isstdinÚ_backupfilenameÚ _encodingÚ_errorsÚflagsÚwarn_default_encodingÚwarningsÚwarnÚEncodingWarningÚ ValueErrorÚDeprecationWarningÚ_modeÚreplaceÚ _write_modeÚcallableÚ _openhook) ÚselfrrrrrrrrArrrÚ__init__¸sV  ÿÿ zFileInput.__init__cCó | ¡dSr©r©rKrrrÚ__del__ìó zFileInput.__del__cCsz | ¡Wd|_dSd|_w)Nr)rr3rOrrrrïs zFileInput.closecCó|SrrrOrrrÚ __enter__õózFileInput.__enter__cCrMrrN)rKÚtypeÚvalueÚ tracebackrrrÚ__exit__ørQzFileInput.__exit__cCrRrrrOrrrÚ__iter__ûrTzFileInput.__iter__cCs4 | ¡}|r|jd7_|S|jst‚| ¡q©NTr$)Ú _readliner:rÚ StopIterationr©rKÚlinerrrÚ__next__þóùzFileInput.__next__cCsNddl}|jdtdd�|| ¡krtdƒ‚z| ¡WSty&tdƒ‚w)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r')Ú stacklevelzaccessing lines out of orderzend of input reached)rArBrErrr_r\Ú IndexError)rKÚirArrrÚ __getitem__ sü   ÿzFileInput.__getitem__cCsÔ|j}d|_|r |t_|j}d|_zm|r| ¡W|j}d|_z|`Wn ty,Ynwz+|r7|js7| ¡W|j }d|_ |rT|j sTzt   |¡Wn t ySYnwd|_dS|j }d|_ |r{|j s{z t   |¡Wd|_wt yzYd|_wwd|_w|j}d|_z|`Wn ty’Ynwz0|r�|js�| ¡W|j }d|_ |rÀ|j sÀz t   |¡Wd|_wt y¿Yd|_wwd|_w|j }d|_ |ræ|j sæz t   |¡Wd|_wt yåYd|_wwd|_w)NF)r6r0Ústdoutr7rrr[ÚAttributeErrorr;r<r5r-ÚunlinkÚOSError)rKZ savestdoutÚoutputÚfileZbackupfilenamerrrrs‚€ ÿ €  ú þþð ÿ € þþú þþzFileInput.nextfilecCs4 | ¡}|r|jd7_|S|js|S| ¡qrZ)r[r:rrr]rrrÚreadline6r`zFileInput.readlinec CsP|js d|jvr dSdS|jd|_|jdd…|_| ¡|_d|_d|_d|_d|_d|jvr6|j p4d}nd}|jdkrWd |_d|jvrOt t j d t j ƒ|_nt j |_d |_nÈ|j rðt |j¡|jpcd |_zt |j¡Wn tywYnwt |j|j¡t|j|j||jd �|_z t |j ¡¡j}Wnty¬t|j|j||jd �|_Yn;wtjtjBtjB}ttdƒrÀ|tjO}t |j||¡}tj ||j||jd �|_z t !|j|¡Wn tyæYnwt j"|_#|jt _"n/|j$�r|j du�r| $|j|j¡|_n|j$|j|j|j |jd �|_n t|j|j||jd �|_|jj%|_&| &¡S)Nr&órrr$FÚlocaler%zÚbufferTz.bak©rrÚO_BINARY)'r3rFr8rr9r:rr;r<r=Úgetattrr0Ústdinr4r-r/r5rgrhÚrenameÚopenr>Úfstatr Úst_moderHr7ÚO_CREATÚO_WRONLYÚO_TRUNCÚhasattrrpÚfdopenÚchmodrer6rJrkr[)rKrZpermrÚfdrrrr[As|       ÿ ÿ ÿ   ÿÿ   ÿ ÿ   ÿ zFileInput._readlinecCó|jSr)r8rOrrrrŠózFileInput.filenamecCs |j|jSr)r9r:rOrrrr�rQzFileInput.linenocCr~r©r:rOrrrr�rzFileInput.filelinenocCs,|jrz|j ¡WStyYdSwdS)Néÿÿÿÿ)rr rDrOrrrr “s  ÿzFileInput.filenocCs |jdkS)Nr$r€rOrrrr œs zFileInput.isfirstlinecCr~r)r;rOrrrr ŸrzFileInput.isstdin©NFr)Ú__name__Ú __module__Ú __qualname__rLrPrrSrXrYr_rdrrkr[rrrr r r Ú classmethodrÚ__class_getitem__rrrrr «s,  ÿ4  I  r rocCsŒ|dur d|vr d}tj |¡d}|dkr!ddl}| ||¡}n|dkr0ddl}| ||¡}nt||||d�Sd|vrDtj|||d�}|S)Nr&rmr$z.gzrz.bz2ro) r-ÚpathÚsplitextÚgziprtÚbz2ZBZ2FileÚioÚ TextIOWrapper)rrrrZextrŠÚstreamr‹rrrr ¥sr cs‡‡fdd„}|S)Ncst||ˆˆd�S)Nro)rt)rrrorrr¹szhook_encoded..openhookr)rrrrrorr¸srcCsÞddl}d}d}| tjdd…d¡\}}|D]\}}|dkr!d}|dkr'|}qt|||d�D]1}|d d…d kr?|dd …}|d d…d krM|dd …}td tƒtƒtƒtƒrZd p[d|fƒq/tdtƒtƒtƒfƒdS)NrFr$zib:z-iTz-b)rrr�Ú ú z%d: %s[%d]%s %sÚ*rz %d: %s[%d]) Úgetoptr0r1rÚprintrrrr )r’rrZoptsÚargsÚoÚar^rrrÚ_test¾s   € ÿr—Ú__main__r‚r)rŒr0r-ÚtypesrÚ__all__rrrrrrrr r r r r rr—rƒrrrrÚs2C  ÿ      {  ÿ