KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/22697/root/usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/22697/root/usr/lib64/python2.4/codecs.pyc
mň
‚=5Dc@sšdZdkZdkZydkTWn"ej
oZede‚nXdddddd	d
ddd
ddddddddddddddgZdZdZ	Z
dZZdZ
d Zeid!joe
ZZe
ZneZZeZe
ZeZe
ZeZd"fd#„ƒYZd$efd%„ƒYZd&efd'„ƒYZd(fd)„ƒYZd*fd+„ƒYZd,dd-d.d/„Zdd-d0„Zd1„Zd2„Z d3„Z!d4„Z"d5„Z#d6„Z$y@e%d-ƒZ&e%d7ƒZ'e%d8ƒZ(e%d9ƒZ)e%d:ƒZ*Wn1e+j
o%dZ&dZ'dZ(dZ)dZ*nXd;Z,e,o
dk-Z-ne.d<jo4eei/d=d>ƒe_/eei0d>d=ƒe_0ndS(?sž codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

N(t*s%Failed to load the builtin codecs: %stregistertlookuptopentEncodedFiletBOMtBOM_BEtBOM_LEtBOM32_BEtBOM32_LEtBOM64_BEtBOM64_LEtBOM_UTF8t	BOM_UTF16tBOM_UTF16_LEtBOM_UTF16_BEt	BOM_UTF32tBOM_UTF32_LEtBOM_UTF32_BEt
strict_errorst
ignore_errorstreplace_errorstxmlcharrefreplace_errorstregister_errortlookup_errorsďťżs˙ţsţ˙s˙ţtţ˙tlittletCodeccBs&tZdZdd„Zdd„ZRS(s­ Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    tstrictcCs
t‚dS(s+ Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamCodec for codecs which have to keep state in order to
            make encoding/decoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N(tNotImplementedError(tselftinputterrors((t/usr/lib64/python2.4/codecs.pytencodebscCs
t‚dS(sú Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamCodec for codecs which have to keep state in order to
            make encoding/decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N(R(RRR ((R!tdecodeus(t__name__t
__module__t__doc__R"R#(((R!RLstStreamWritercBs;tZdd„Zd„Zd„Zd„Zed„ZRS(NRcCs||_||_dS(s[ Creates a StreamWriter instance.

            stream must be a file-like object open for writing
            (binary) data.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences (only for encoding).

            The set of allowed parameter values can be extended via
            register_error.
        N(tstreamRR (RR(R ((R!t__init__•s	cCs/|i||iƒ\}}|ii|ƒdS(s> Writes the object's contents encoded to self.stream.
        N(RR"tobjectR tdatatconsumedR(twrite(RR*R+R,((R!R-ŽscCs|idi|ƒƒdS(s[ Writes the concatenated list of strings to the stream
            using .write().
        tN(RR-tjointlist(RR0((R!t
writelinesľscCsdS(s5 Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        N((R((R!tresetźs	cCs||i|ƒS(s? Inherit all other methods from the underlying stream.
        N(tgetattrRR(tname(RR4R3((R!t__getattr__Čs(R$R%R)R-R1R2R3R5(((R!R'“s
			tStreamReadercBsƒtZdd„Zdd„Zdded„Zded„Zded„Z	d„Z
d	d
„Zd„Zd„Z
ed
„ZRS(NRcCs1||_||_d|_d|_d|_dS(s[ Creates a StreamReader instance.

            stream must be a file-like object open for reading
            (binary) data.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character;

            The set of allowed parameter values can be extended via
            register_error.
        R.N(R(RR t
bytebuffert
charbuffertNonet
linebuffer(RR(R ((R!R)Ós				cCs
t‚dS(N(R(RRR ((R!R#ísi˙˙˙˙cCsÝ|io"di|iƒ|_d|_nxjtob|djo?|djo|ioPq~qt|iƒ|joPqnt|iƒ|joPn|djo|i	i
ƒ}n|i	i
|ƒ}|i|}y|i||iƒ\}	}Wnntj
ob}
|oO|i||
i |iƒ\}	}|	itƒ}t|ƒdjo‚qgql‚nX|||_|i|	7_|pPq/q/W|djo|i}d|_n|i| }|i||_|S(s Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of characters to read from the
            stream. read() will never return more than chars
            characters, but it might return less, if there are not enough
            characters available.

            size indicates the approximate maximum number of bytes to
            read from the stream for decoding purposes. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        R.iiN(RR:R/R8R9tTruetcharstsizetlenR(treadtnewdataR7R+R#R tnewcharstdecodedbytestUnicodeDecodeErrortexct	firstlinetstartt
splitlinestlinestresult(RR=R<RERBR+RHR@RIRARD((R!R?đsJ




		

"


	

c	Csm|iop|id}|id=t|iƒdjo|id|_d|_n|p|itƒd}n|Sn|pd}d}xŮtoŃ|i|dtƒ}|o4|idƒo ||iddddƒ7}qçn||7}|itƒ}|ot|ƒdjo„|d}|d=t|ƒdjo)|d	c|i7<||_d|_n|d|i|_|p|itƒd}nPn|d}|ditƒd}||jo9di|dƒ|i|_|o
|}n|}Pq	n|p
|dj	o+|o|o|itƒd}nPn|d
jo|d9}qqW|S(
są Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        iiiHR.REs
R=R<i˙˙˙˙i@iN(RR:tlineR>R8R9tkeependsRGtFalseR=treadsizeR;R?R+tendswithRHtline0withendtline0withoutendR/(	RR=RKRORPR+RHRMRJ((R!treadline?s^




$

	



	
cCs|iƒ}|i|ƒS(sZ Read all lines available on the input stream
            and return them as list of lines.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        N(RR?R+RGRK(RtsizehintRKR+((R!t	readlinesˆscCsd|_d|_d|_dS(să Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        R.uN(RR7R8R9R:(R((R!R2—s		icCs!|iƒ|ii||ƒdS(sp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        N(RR2R(tseektoffsettwhence(RRURV((R!RT¤s
cCs%|iƒ}|o|Snt‚dS(s4 Return the next decoded line from the input stream.N(RRQRJt
StopIteration(RRJ((R!tnextŹs
cCs|S(N(R(R((R!t__iter__´scCs||i|ƒS(s? Inherit all other methods from the underlying stream.
        N(R3RR(R4(RR4R3((R!R5ˇs(R$R%R)R#RLR?R9R;RQRSR2RTRXRYR3R5(((R!R6ŃsOI	
		tStreamReaderWritercBs}tZdZdZdd„Zdd„Zed„Zed„Zd„Z	d	„Z
d
„Zd„Zd„Z
ed
„ZRS(s StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    tunknownRcCs:||_|||ƒ|_|||ƒ|_||_dS(sR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N(R(RtReaderR treadertWritertwriter(RR(R\R^R ((R!R)Ís
	i˙˙˙˙cCs|ii|ƒS(N(RR]R?R=(RR=((R!R?ßscCs|ii|ƒS(N(RR]RQR=(RR=((R!RQăscCs|ii|ƒS(N(RR]RSRR(RRR((R!RSçscCs
|iiƒS(s4 Return the next decoded line from the input stream.N(RR]RX(R((R!RXëscCs|S(N(R(R((R!RYđscCs|ii|ƒS(N(RR_R-R+(RR+((R!R-óscCs|ii|ƒS(N(RR_R1R0(RR0((R!R1÷scCs|iiƒ|iiƒdS(N(RR]R2R_(R((R!R2űs
cCs||i|ƒS(s? Inherit all other methods from the underlying stream.
        N(R3RR(R4(RR4R3((R!R5s(R$R%R&tencodingR)R?R9RQRSRXRYR-R1R2R3R5(((R!RZŔs						t
StreamRecodercBsƒtZdZdZdZdd„Zdd„Zed„Zed„Z	d„Z
d	„Zd
„Zd„Z
d„Zed
„ZRS(sE StreamRecoder instances provide a frontend - backend
        view of encoding data.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the stream is first decoded into an
        intermediate format (which is dependent on the given codec
        combination) and then written to the stream using an instance
        of the provided Writer class.

        In the other direction, data is read from the stream using a
        Reader instance and then return encoded data to the caller.

    R[RcCsL||_||_||_|||ƒ|_|||ƒ|_||_dS(sş Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            input to .read() and output of .write()) while
            Reader and Writer work on the backend (reading and
            writing to the stream).

            You can use these objects to do transparent direct
            recodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode, decode must adhere to the Codec interface, Reader,
            Writer must be factory functions or classes providing the
            StreamReader, StreamWriter interface resp.

            encode and decode are needed for the frontend translation,
            Reader and Writer for the backend translation. Unicode is
            used as intermediate encoding.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N(	R(RR"R#R\R R]R^R_(RR(R"R#R\R^R ((R!R)s			i˙˙˙˙cCs1|ii|ƒ}|i||iƒ\}}|S(N(RR]R?R=R+R"R tbytesencoded(RR=RbR+((R!R??scCsQ|djo|iiƒ}n|ii|ƒ}|i||iƒ\}}|S(N(	R=R9RR]RQR+R"R Rb(RR=RbR+((R!RQEs

cCs7|iiƒ}|i||iƒ\}}|idƒS(Ni(RR]R?R+R"R RbRG(RRRR+Rb((R!RSNscCs.|iiƒ}|i||iƒ\}}|S(s4 Return the next decoded line from the input stream.N(RR]RXR+R"R Rb(RRbR+((R!RXTscCs|S(N(R(R((R!RY[scCs+|i||iƒ\}}|ii|ƒS(N(RR#R+R tbytesdecodedR_R-(RR+Rc((R!R-^scCs:di|ƒ}|i||iƒ\}}|ii|ƒS(NR.(	R/R0R+RR#R RcR_R-(RR0R+Rc((R!R1cscCs|iiƒ|iiƒdS(N(RR]R2R_(R((R!R2is
cCs||i|ƒS(s? Inherit all other methods from the underlying stream.
        N(R3RR(R4(RR4R3((R!R5ns(R$R%R&t
data_encodingt
file_encodingR)R?R9RQRSRXRYR-R1R2R3R5(((R!Ra	s!						trbRicCsŒ|dj	od|jo|d}nti|||ƒ}	|djo|	Snt|ƒ\}}}}t
|	|||ƒ}
||
_|
S(s­ Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually by
        Unicode as well.

        Files are always opened in binary mode, even if no binary mode
        was specified. This is done to avoid data loss due to encodings
        using 8-bit values. The default file mode is 'rb' meaning to
        open the file in binary read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to line buffered.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    tbN(R`R9tmodet__builtin__Rtfilenamet	bufferingtfileRtetdtsrtswRZR tsrw(RjRhR`R RkRmRnRoRpRlRq((R!Rws
	c	Cst|djo
|}nt|ƒd \}}t|ƒd\}}t||||||ƒ}||_||_|S(sĺ Return a wrapped version of file which provides transparent
        encoding translation.

        Strings written to the wrapped file are interpreted according
        to the given data_encoding and then written to the original
        file as string using file_encoding. The intermediate encoding
        will usually be Unicode but depends on the specified codecs.

        Strings are read from the file using file_encoding and then
        passed back to the caller as string using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    iN(ReR9RdRR"R#R\R^RaRlR Ro(	RlRdReR RoR^R#R\R"((R!RŁs

			cCst|ƒdS(sž Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    iN(RR`(R`((R!t
getencoderĘscCst|ƒdS(sž Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    iN(RR`(R`((R!t
getdecoderÔscCst|ƒdS(s´ Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    iN(RR`(R`((R!t	getreaderŢscCst|ƒdS(s´ Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    iN(RR`(R`((R!t	getwriterčscCs%h}x|D]}|||<q
W|S(sˆ make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    N(trestrngti(RwRxRv((R!tmake_identity_dictôscCsLh}x?|iƒD]1\}}||jo|||<qd||<qW|S(s‚ Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N(tmtdecoding_maptitemstktvR9(R{RzR}R~((R!tmake_encoding_maps

tignoretreplacetxmlcharrefreplacetbackslashreplaceit__main__slatin-1sutf-8(1R&Ritsyst_codecstImportErrortwhytSystemErrort__all__RRRRRRRt	byteorderRR
RR	RRR
RR'R6RZRaR9RRRrRsRtRuRyRRRRRRtbackslashreplace_errorstLookupErrort_falset	encodingsR$tstdouttstdin(&RtRRiRRRRRŽRRRR'RŠR
RRuRRR6RRsRaR…RŒRRR
RˆRRR	RZRRRrRyRR((R!t?sfN




G>ďIn,'	
	
	
		
	



Anon7 - 2021