B F^v,@sddlZddlZy ddlTWn.ek rJZzedeWddZ[XYnXdddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g,Zd0Zd1ZZ d2Z Z d3Z d4Z ejd5kre ZZe Zn e ZZe Ze Ze Ze Ze ZGd6ddeZGd7ddZGd8ddeZGd9d:d:eZGd;ddeZGdddeZGd?ddeZGd@ddZ GdAddZ!d[dEdZ"d\dFdZ#dGdZ$dHdZ%dId Z&dJd!Z'dKd"Z(dLd#Z)d]dMd&Z*d^dNd'Z+dOdPZ,dQdRZ-y4e.dCZ/e.dSZ0e.dTZ1e.dUZ2e.dVZ3e.dWZ4Wn.e5k r\dZ/dZ0dZ1dZ2dZ3dZ4YnXdZ6e6rpddl7Z7e8dXkre#ej9dYdZe_9e#ej:dZdYe_:dS)_N)*z%Failed to load the builtin codecs: %sregisterlookupopen EncodedFileBOMBOM_BEBOM_LEBOM32_BEBOM32_LEBOM64_BEBOM64_LEBOM_UTF8 BOM_UTF16 BOM_UTF16_LE BOM_UTF16_BE BOM_UTF32 BOM_UTF32_LE BOM_UTF32_BE CodecInfoCodecIncrementalEncoderIncrementalDecoder StreamReader StreamWriterStreamReaderWriter StreamRecoder getencoder getdecodergetincrementalencodergetincrementaldecoder getreader getwriterencodedecode iterencode iterdecode strict_errors ignore_errorsreplace_errorsxmlcharrefreplace_errorsbackslashreplace_errorsnamereplace_errorsregister_error lookup_errorssssslittlec@s(eZdZdZdddddZddZdS) rTN)_is_text_encodingc CsPt|||||f} || _|| _|| _|| _|| _|| _|| _|dk rL|| _ | S)N) tuple__new__namer#r$incrementalencoderincrementaldecoder streamwriter streamreaderr0) clsr#r$r7r6r4r5r3r0selfr:)/opt/alt/python37/lib/python3.7/codecs.pyr2^szCodecInfo.__new__cCsd|jj|jj|jt|fS)Nz%<%s.%s object for encoding %s at %#x>) __class__ __module__ __qualname__r3id)r9r:r:r;__repr__ms zCodecInfo.__repr__)NNNNN)__name__r=r>r0r2r@r:r:r:r;rSs   c@s eZdZdddZdddZdS) rstrictcCstdS)N)NotImplementedError)r9inputerrorsr:r:r;r#sz Codec.encodecCstdS)N)rC)r9rDrEr:r:r;r$sz Codec.decodeN)rB)rB)rAr=r>r#r$r:r:r:r;rrs c@s8eZdZdddZdddZddZd d Zd d Zd S)rrBcCs||_d|_dS)N)rEbuffer)r9rEr:r:r;__init__szIncrementalEncoder.__init__FcCstdS)N)rC)r9rDfinalr:r:r;r#szIncrementalEncoder.encodecCsdS)Nr:)r9r:r:r;resetszIncrementalEncoder.resetcCsdS)Nrr:)r9r:r:r;getstateszIncrementalEncoder.getstatecCsdS)Nr:)r9stater:r:r;setstateszIncrementalEncoder.setstateN)rB)F)rAr=r>rHr#rJrKrMr:r:r:r;rs  c@s@eZdZdddZddZdddZd d Zd d Zd dZdS)BufferedIncrementalEncoderrBcCst||d|_dS)NrF)rrHrG)r9rEr:r:r;rHs z#BufferedIncrementalEncoder.__init__cCstdS)N)rC)r9rDrErIr:r:r;_buffer_encodesz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|||j|\}}||d|_|S)N)rGrOrE)r9rDrIdataresultconsumedr:r:r;r#s z!BufferedIncrementalEncoder.encodecCst|d|_dS)NrF)rrJrG)r9r:r:r;rJs z BufferedIncrementalEncoder.resetcCs |jpdS)Nr)rG)r9r:r:r;rKsz#BufferedIncrementalEncoder.getstatecCs|pd|_dS)NrF)rG)r9rLr:r:r;rMsz#BufferedIncrementalEncoder.setstateN)rB)F) rAr=r>rHrOr#rJrKrMr:r:r:r;rNs   rNc@s8eZdZdddZdddZddZd d Zd d Zd S)rrBcCs ||_dS)N)rE)r9rEr:r:r;rHszIncrementalDecoder.__init__FcCstdS)N)rC)r9rDrIr:r:r;r$szIncrementalDecoder.decodecCsdS)Nr:)r9r:r:r;rJszIncrementalDecoder.resetcCsdS)N)rr:)r9r:r:r;rKs zIncrementalDecoder.getstatecCsdS)Nr:)r9rLr:r:r;rM'szIncrementalDecoder.setstateN)rB)F)rAr=r>rHr$rJrKrMr:r:r:r;rs  c@s@eZdZdddZddZdddZd d Zd d Zd dZdS)BufferedIncrementalDecoderrBcCst||d|_dS)NrS)rrHrG)r9rEr:r:r;rH5s z#BufferedIncrementalDecoder.__init__cCstdS)N)rC)r9rDrErIr:r:r;_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|||j|\}}||d|_|S)N)rGrUrE)r9rDrIrPrQrRr:r:r;r$?s z!BufferedIncrementalDecoder.decodecCst|d|_dS)NrS)rrJrG)r9r:r:r;rJGs z BufferedIncrementalDecoder.resetcCs |jdfS)Nr)rG)r9r:r:r;rKKsz#BufferedIncrementalDecoder.getstatecCs|d|_dS)Nr)rG)r9rLr:r:r;rMOsz#BufferedIncrementalDecoder.setstateN)rB)F) rAr=r>rHrUr$rJrKrMr:r:r:r;rT/s   rTc@sTeZdZdddZddZddZdd Zdd d Zefd dZ ddZ ddZ dS)rrBcCs||_||_dS)N)streamrE)r9rVrEr:r:r;rH\szStreamWriter.__init__cCs"|||j\}}|j|dS)N)r#rErVwrite)r9objectrPrRr:r:r;rWuszStreamWriter.writecCs|d|dS)NrF)rWjoin)r9listr:r:r; writelines|szStreamWriter.writelinescCsdS)Nr:)r9r:r:r;rJs zStreamWriter.resetrcCs*|j|||dkr&|dkr&|dS)Nr)rVseekrJ)r9offsetwhencer:r:r;r\szStreamWriter.seekcCs ||j|S)N)rV)r9r3getattrr:r:r; __getattr__szStreamWriter.__getattr__cCs|S)Nr:)r9r:r:r; __enter__szStreamWriter.__enter__cCs|jdS)N)rVclose)r9typevaluetbr:r:r;__exit__szStreamWriter.__exit__N)rB)r) rAr=r>rHrWr[rJr\r_r`rarfr:r:r:r;rZs   c@seZdZeZdddZd ddZd!dd Zd"d d Zd#ddZ ddZ d$ddZ ddZ ddZ efddZddZddZd S)%rrBcCs.||_||_d|_||_|j|_d|_dS)NrS)rVrE bytebuffercharbuffertype_empty_charbuffer charbuffer linebuffer)r9rVrEr:r:r;rHs  zStreamReader.__init__cCstdS)N)rC)r9rDrEr:r:r;r$szStreamReader.decodeFc CsL|jr|j|j|_d|_|dkr(|}x|dkrBt|j|krBP|dkrV|j}n |j|}|j|}|srPy|||j \}}Wn`t k r}zB|r||d|j |j \}}|j dd} t| dkr؂nWdd}~XYnX||d|_|j|7_|s*Pq*W|dkr*|j} |j|_n|jd|} |j|d|_| S)NrT)keepends) rkrirYrjlenrVreadrgr$rEUnicodeDecodeErrorstart splitlines) r9sizechars firstlinenewdatarPnewchars decodedbytesexclinesrQr:r:r;rpsD       zStreamReader.readNTc Cs|jrP|jd}|jd=t|jdkr8|jd|_d|_|sL|jddd}|S|pVd}|j}xn|j|dd}|rt|tr|dst|t r|d r||jddd 7}||7}|jdd}|rt|dkr:|d}|d=t|dkr|d |j7<||_d|_n|d|j|_|s8|jddd}P|d}|djddd}||kr|j |dd|j|_|r|}n|}P|r|dk r|r|s|jddd}P|d krb|d 9}qbW|S)NrrnF)rmHT)rv  )rtrurli@) rkrorjrsrirp isinstancestrendswithbytesrY) r9rtrmlinereadsizerPr{ line0withendline0withoutendr:r:r;readlines^        zStreamReader.readlinecCs|}||S)N)rprs)r9sizehintrmrPr:r:r; readlines^s zStreamReader.readlinescCsd|_|j|_d|_dS)NrS)rgrirjrk)r9r:r:r;rJms zStreamReader.resetrcCs|j|||dS)N)rVr\rJ)r9r]r^r:r:r;r\zszStreamReader.seekcCs|}|r|StdS)N)r StopIteration)r9rr:r:r;__next__szStreamReader.__next__cCs|S)Nr:)r9r:r:r;__iter__szStreamReader.__iter__cCs ||j|S)N)rV)r9r3r_r:r:r;r`szStreamReader.__getattr__cCs|S)Nr:)r9r:r:r;raszStreamReader.__enter__cCs|jdS)N)rVrb)r9rcrdrer:r:r;rfszStreamReader.__exit__)rB)rB)rlrlF)NT)NT)r)rAr=r>rrhrHr$rprrrJr\rrr_r`rarfr:r:r:r;rs   P K   c@seZdZdZd ddZd!ddZd"d d Zd#d d Zd dZddZ ddZ ddZ ddZ d$ddZ efddZddZddZdS)%runknownrBcCs(||_||||_||||_||_dS)N)rVreaderwriterrE)r9rVReaderWriterrEr:r:r;rHs   zStreamReaderWriter.__init__rlcCs |j|S)N)rrp)r9rtr:r:r;rpszStreamReaderWriter.readNcCs |j|S)N)rr)r9rtr:r:r;rszStreamReaderWriter.readlinecCs |j|S)N)rr)r9rr:r:r;rszStreamReaderWriter.readlinescCs t|jS)N)nextr)r9r:r:r;rszStreamReaderWriter.__next__cCs|S)Nr:)r9r:r:r;rszStreamReaderWriter.__iter__cCs |j|S)N)rrW)r9rPr:r:r;rWszStreamReaderWriter.writecCs |j|S)N)rr[)r9rZr:r:r;r[szStreamReaderWriter.writelinescCs|j|jdS)N)rrJr)r9r:r:r;rJs zStreamReaderWriter.resetrcCs6|j|||j|dkr2|dkr2|jdS)Nr)rVr\rrJr)r9r]r^r:r:r;r\s zStreamReaderWriter.seekcCs ||j|S)N)rV)r9r3r_r:r:r;r`szStreamReaderWriter.__getattr__cCs|S)Nr:)r9r:r:r;raszStreamReaderWriter.__enter__cCs|jdS)N)rVrb)r9rcrdrer:r:r;rfszStreamReaderWriter.__exit__)rB)rl)N)N)r)rAr=r>encodingrHrprrrrrWr[rJr\r_r`rarfr:r:r:r;rs       c@seZdZdZdZd ddZd!ddZd"d d Zd#d d Zd dZ ddZ ddZ ddZ ddZ d$ddZefddZddZddZdS)%rrrBcCs4||_||_||_||||_||||_||_dS)N)rVr#r$rrrE)r9rVr#r$rrrEr:r:r;rHs   zStreamRecoder.__init__rlcCs"|j|}|||j\}}|S)N)rrpr#rE)r9rtrP bytesencodedr:r:r;rp#s zStreamRecoder.readNcCs6|dkr|j}n |j|}|||j\}}|S)N)rrr#rE)r9rtrPrr:r:r;r)s   zStreamRecoder.readlinecCs(|j}|||j\}}|jddS)NT)rm)rrpr#rErs)r9rrPrr:r:r;r2s zStreamRecoder.readlinescCs t|j}|||j\}}|S)N)rrr#rE)r9rPrr:r:r;r8s zStreamRecoder.__next__cCs|S)Nr:)r9r:r:r;r?szStreamRecoder.__iter__cCs|||j\}}|j|S)N)r$rErrW)r9rP bytesdecodedr:r:r;rWBszStreamRecoder.writecCs(d|}|||j\}}|j|S)NrS)rYr$rErrW)r9rZrPrr:r:r;r[Gs zStreamRecoder.writelinescCs|j|jdS)N)rrJr)r9r:r:r;rJMs zStreamRecoder.resetrcCs |j|||j||dS)N)rr\r)r9r]r^r:r:r;r\RszStreamRecoder.seekcCs ||j|S)N)rV)r9r3r_r:r:r;r`XszStreamRecoder.__getattr__cCs|S)Nr:)r9r:r:r;ra_szStreamRecoder.__enter__cCs|jdS)N)rVrb)r9rcrdrer:r:r;rfbszStreamRecoder.__exit__)rB)rl)N)N)r)rAr=r> data_encoding file_encodingrHrprrrrrWr[rJr\r_r`rarfr:r:r:r;rs     rrBrncCsr|dk rd|kr|d}t|||}|dkr2|Sy$t|}t||j|j|}||_|S|YnXdS)Nb)builtinsrrrr7r6rrb)filenamemoderrE bufferingfileinfosrwr:r:r;rgscCsF|dkr |}t|}t|}t||j|j|j|j|}||_||_|S)N)rrr#r$r7r6rr)rrrrE data_info file_infosrr:r:r;rs cCs t|jS)N)rr#)rr:r:r;rscCs t|jS)N)rr$)rr:r:r;rscCst|j}|dkrt||S)N)rr4 LookupError)rencoderr:r:r;rs cCst|j}|dkrt||S)N)rr5r)rdecoderr:r:r;r s cCs t|jS)N)rr7)rr:r:r;r!scCs t|jS)N)rr6)rr:r:r;r"scksLt||f|}x |D]}||}|r|VqW|dd}|rH|VdS)NrFT)rr#)iteratorrrEkwargsrrDoutputr:r:r;r%s     cksLt||f|}x |D]}||}|r|VqW|dd}|rH|VdS)NrST)r r$)rrrErrrDrr:r:r;r&s     cCsdd|DS)NcSsi|] }||qSr:r:).0ir:r:r; .sz&make_identity_dict..r:)rngr:r:r;make_identity_dict&srcCs8i}x.|D]"\}}||kr(|||<qd||<qW|S)N)items) decoding_mapmkvr:r:r;make_encoding_map0s   rignorereplacexmlcharrefreplacebackslashreplace namereplace__main__zlatin-1zutf-8)rNrBrn)NrB)rB)rB);rsys_codecs ImportErrorZwhy SystemError__all__rr rrrrr byteorderrrrr r r r r1rrrXrrNrrTrrrrrrrrrr r!r"r%r&rrr.r'r(r)r*r+r,r_false encodingsrAstdoutstdinr:r:r:r; s     B("1+IzWt / &