ftc&@sndZddlZddlZyddlTWn5ek rcZzedeWYddZ[XnXddddd d d d d dddddddddddddddgZdZdZ Z dZ Z d Z d!Zejd"kre ZZe Zne ZZeZe Ze Ze ZeZGd#d$d$eZGd%d&d&ZGd'd(d(eZGd)d*d*eZGd+d,d,eZGd-d.d.eZGd/d0d0eZGd1d2d2eZ Gd3d4d4Z!Gd5d6d6Z"d7dd8d9d:dZ$dd8d;dZ%d<d=Z&d>d?Z'd@dAZ(dBdCZ)dDdEZ*dFdGZ+d8dHdIZ,d8dJdKZ-dLdMZ.dNdOZ/y@e0d8Z1e0dPZ2e0dQZ3e0dRZ4e0dSZ5Wn0e6k rdZ1dZ2dZ3dZ4dZ5YnXdZ7e7r+ddl8Z8ne9dTkrje%ej:dUdVe_:e%ej;dVdUe_;ndS(Wu codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. iN(u*u%Failed to load the builtin codecs: %suregisterulookupuopenu EncodedFileuBOMuBOM_BEuBOM_LEuBOM32_BEuBOM32_LEuBOM64_BEuBOM64_LEuBOM_UTF8u BOM_UTF16u BOM_UTF16_LEu BOM_UTF16_BEu BOM_UTF32u BOM_UTF32_LEu BOM_UTF32_BEu strict_errorsu ignore_errorsureplace_errorsuxmlcharrefreplace_errorsuregister_erroru lookup_errorsssssulittlec BsM|EeZdZdZdZdddddddddZddZdS( u CodecInfou0Codec details when looking up the codec registryu_is_text_encodingc Csytj|||||f} || _|| _|| _|| _|| _|| _|| _|dk ru|| _ n| S(N( utupleu__new__unameuencodeudecodeuincrementalencoderuincrementaldecoderu streamwriteru streamreaderuNoneu_is_text_encoding( uclsuencodeudecodeu streamreaderu streamwriteruincrementalencoderuincrementaldecoderunameu_is_text_encodinguself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__new__Vs         uCodecInfo.__new__cCs)d|jj|jj|jt|fS(Nu&<%s.%s object for encoding %s at 0x%x>(u __class__u __module__u__name__unameuid(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__repr__esuCodecInfo.__repr__NT( u__name__u __module__u __qualname__u__doc__uTrueu_is_text_encodinguNoneu__new__u__repr__(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyu CodecInfoKs  u CodecInfocBs8|EeZdZdZdddZdddZdS(uCodecu 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. 'surrogateescape' - replace with private codepoints U+DCnn. '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. ustrictcCs tdS(u+ 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(uNotImplementedError(uselfuinputuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyuencodesu Codec.encodecCs tdS(u 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(uNotImplementedError(uselfuinputuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyudecodesu Codec.decodeN(u__name__u __module__u __qualname__u__doc__uencodeudecode(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuCodecjsuCodeccBs\|EeZdZdZdddZdddZddZd d Zd d Z d S(uIncrementalEncoderu An IncrementalEncoder encodes an input in multiple steps. The input can be passed piece by piece to the encode() method. The IncrementalEncoder remembers the state of the encoding process between calls to encode(). ustrictcCs||_d|_dS(u Creates an IncrementalEncoder instance. The IncrementalEncoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values. uN(uerrorsubuffer(uselfuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__s uIncrementalEncoder.__init__cCs tdS(uA Encodes input and returns the resulting object. N(uNotImplementedError(uselfuinputufinal((u+/opt/alt/python33/lib64/python3.3/codecs.pyuencodesuIncrementalEncoder.encodecCsdS(u: Resets the encoder to the initial state. N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresetsuIncrementalEncoder.resetcCsdS(u: Return the current state of the encoder. i((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetstatesuIncrementalEncoder.getstatecCsdS(ul Set the current state of the encoder. state must have been returned by getstate(). N((uselfustate((u+/opt/alt/python33/lib64/python3.3/codecs.pyusetstatesuIncrementalEncoder.setstateNF( u__name__u __module__u __qualname__u__doc__u__init__uFalseuencodeuresetugetstateusetstate(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuIncrementalEncoders    uIncrementalEncodercBsh|EeZdZdZdddZddZdddZd d Zd d Z d dZ dS(uBufferedIncrementalEncoderu This subclass of IncrementalEncoder can be used as the baseclass for an incremental encoder if the encoder must keep some of the output in a buffer between calls to encode(). ustrictcCstj||d|_dS(Nu(uIncrementalEncoderu__init__ubuffer(uselfuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__su#BufferedIncrementalEncoder.__init__cCs tdS(N(uNotImplementedError(uselfuinputuerrorsufinal((u+/opt/alt/python33/lib64/python3.3/codecs.pyu_buffer_encodesu)BufferedIncrementalEncoder._buffer_encodecCsB|j|}|j||j|\}}||d|_|S(N(ubufferu_buffer_encodeuerrors(uselfuinputufinaludatauresultuconsumed((u+/opt/alt/python33/lib64/python3.3/codecs.pyuencodes u!BufferedIncrementalEncoder.encodecCstj|d|_dS(Nu(uIncrementalEncoderuresetubuffer(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresets u BufferedIncrementalEncoder.resetcCs |jp dS(Ni(ubuffer(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetstatesu#BufferedIncrementalEncoder.getstatecCs|p d|_dS(Nu(ubuffer(uselfustate((u+/opt/alt/python33/lib64/python3.3/codecs.pyusetstatesu#BufferedIncrementalEncoder.setstateNF( u__name__u __module__u __qualname__u__doc__u__init__u_buffer_encodeuFalseuencodeuresetugetstateusetstate(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuBufferedIncrementalEncoders   uBufferedIncrementalEncodercBs\|EeZdZdZdddZdddZddZd d Zd d Z d S(uIncrementalDecoderu An IncrementalDecoder decodes an input in multiple steps. The input can be passed piece by piece to the decode() method. The IncrementalDecoder remembers the state of the decoding process between calls to decode(). ustrictcCs ||_dS(u Create a IncrementalDecoder instance. The IncrementalDecoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values. N(uerrors(uselfuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__suIncrementalDecoder.__init__cCs tdS(u@ Decode input and returns the resulting object. N(uNotImplementedError(uselfuinputufinal((u+/opt/alt/python33/lib64/python3.3/codecs.pyudecodesuIncrementalDecoder.decodecCsdS(u9 Reset the decoder to the initial state. N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyureset suIncrementalDecoder.resetcCsdS(u  Return the current state of the decoder. This must be a (buffered_input, additional_state_info) tuple. buffered_input must be a bytes object containing bytes that were passed to decode() that have not yet been converted. additional_state_info must be a non-negative integer representing the state of the decoder WITHOUT yet having processed the contents of buffered_input. In the initial state and after reset(), getstate() must return (b"", 0). si(si((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetstates uIncrementalDecoder.getstatecCsdS(u Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset(). N((uselfustate((u+/opt/alt/python33/lib64/python3.3/codecs.pyusetstatesuIncrementalDecoder.setstateNF( u__name__u __module__u __qualname__u__doc__u__init__uFalseudecodeuresetugetstateusetstate(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuIncrementalDecoders    uIncrementalDecodercBsh|EeZdZdZdddZddZdddZd d Zd d Z d dZ dS(uBufferedIncrementalDecoderu This subclass of IncrementalDecoder can be used as the baseclass for an incremental decoder if the decoder must be able to handle incomplete byte sequences. ustrictcCstj||d|_dS(Ns(uIncrementalDecoderu__init__ubuffer(uselfuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__,su#BufferedIncrementalDecoder.__init__cCs tdS(N(uNotImplementedError(uselfuinputuerrorsufinal((u+/opt/alt/python33/lib64/python3.3/codecs.pyu_buffer_decode1su)BufferedIncrementalDecoder._buffer_decodecCsB|j|}|j||j|\}}||d|_|S(N(ubufferu_buffer_decodeuerrors(uselfuinputufinaludatauresultuconsumed((u+/opt/alt/python33/lib64/python3.3/codecs.pyudecode6s u!BufferedIncrementalDecoder.decodecCstj|d|_dS(Ns(uIncrementalDecoderuresetubuffer(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyureset>s u BufferedIncrementalDecoder.resetcCs |jdfS(Ni(ubuffer(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetstateBsu#BufferedIncrementalDecoder.getstatecCs|d|_dS(Ni(ubuffer(uselfustate((u+/opt/alt/python33/lib64/python3.3/codecs.pyusetstateFsu#BufferedIncrementalDecoder.setstateNF( u__name__u __module__u __qualname__u__doc__u__init__u_buffer_decodeuFalseudecodeuresetugetstateusetstate(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuBufferedIncrementalDecoder&s   uBufferedIncrementalDecodercBs}|EeZdZdddZddZddZdd Zd d d Zed dZ ddZ ddZ dS(u StreamWriterustrictcCs||_||_dS(u[ 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(ustreamuerrors(uselfustreamuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__Ss uStreamWriter.__init__cCs/|j||j\}}|jj|dS(u> Writes the object's contents encoded to self.stream. N(uencodeuerrorsustreamuwrite(uselfuobjectudatauconsumed((u+/opt/alt/python33/lib64/python3.3/codecs.pyuwritelsuStreamWriter.writecCs|jdj|dS(u[ Writes the concatenated list of strings to the stream using .write(). uN(uwriteujoin(uselfulist((u+/opt/alt/python33/lib64/python3.3/codecs.pyu writelinesssuStreamWriter.writelinescCsdS(u5 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((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresetzs uStreamWriter.reseticCs<|jj|||dkr8|dkr8|jndS(Ni(ustreamuseekureset(uselfuoffsetuwhence((u+/opt/alt/python33/lib64/python3.3/codecs.pyuseeksuStreamWriter.seekcCs||j|S(u? Inherit all other methods from the underlying stream. (ustream(uselfunameugetattr((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __getattr__suStreamWriter.__getattr__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __enter__suStreamWriter.__enter__cCs|jjdS(N(ustreamuclose(uselfutypeuvalueutb((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__exit__suStreamWriter.__exit__N( u__name__u __module__u __qualname__u__init__uwriteu writelinesuresetuseekugetattru __getattr__u __enter__u__exit__(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyu StreamWriterQs    u StreamWritercBs|EeZdZeZdddZdddZdddddZdd d d Z dd d d Z d dZ dddZddZddZeddZddZddZdS(!u StreamReaderustrictcCsC||_||_d|_|j|_|j|_d|_dS(u[ 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. sN(ustreamuerrorsu bytebufferucharbuffertypeu_empty_charbufferu charbufferuNoneu linebuffer(uselfustreamuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__s     uStreamReader.__init__cCs tdS(N(uNotImplementedError(uselfuinputuerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyudecodesuStreamReader.decodeic Cs|jr-|jj|j|_d|_nxk|dkrXt|j|krPqn(|dkrt|j|krPqn|dkr|jj}n|jj|}|j|}|sPny|j ||j \}}Wnt k rk}zc|rV|j |d|j |j \}}|j dd} t| dkrYqYnWYdd}~XnX||d|_|j|7_|s0Pq0q0|dkr|j} |j|_n)|jd|} |j|d|_| S(u 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. iNukeependsiT(u linebufferu_empty_charbufferujoinu charbufferuNoneulenustreamureadu bytebufferudecodeuerrorsuUnicodeDecodeErrorustartu splitlinesuTrue( uselfusizeucharsu firstlineunewdataudataunewcharsu decodedbytesuexculinesuresult((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadsF      (   uStreamReader.readc Cs|jrt|jd}|jd=t|jdkrQ|jd|_d |_n|sp|jdd d}n|S|p}d}|j}x|j|dd}|rt |t r|j dst |t r|j dr||jddd d7}qn||7}|jdd}|r+t|dkr|d}|d=t|dkr|d|j7<||_d |_n|d|j|_|s|jdd d}nPn|d}|djdd d}||kr+|jj |dd |j|_|r|}n|}Pq+n| s>|d k rh|rd| rd|jdd d}nPn|d kr|d 9}qq|S(u Read one line from the input stream and return the decoded data. size, if given, is passed as size argument to the read() method. iiukeependsiHu firstlineu s usizeucharsNi@iFTi(u linebufferulenu charbufferuNoneu splitlinesuFalseu_empty_charbufferureaduTrueu isinstanceustruendswithubytesujoin( uselfusizeukeependsulineureadsizeudataulinesu line0withenduline0withoutend((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadline s^      "          uStreamReader.readlinecCs|j}|j|S(uZ 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. (ureadu splitlines(uselfusizehintukeependsudata((u+/opt/alt/python33/lib64/python3.3/codecs.pyu readlinesTs uStreamReader.readlinescCs"d|_|j|_d|_dS(u 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. sN(u bytebufferu_empty_charbufferu charbufferuNoneu linebuffer(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresetcs  uStreamReader.reseticCs!|jj|||jdS(up Set the input stream's current position. Resets the codec buffers used for keeping state. N(ustreamuseekureset(uselfuoffsetuwhence((u+/opt/alt/python33/lib64/python3.3/codecs.pyuseekpsuStreamReader.seekcCs |j}|r|StdS(u4 Return the next decoded line from the input stream.N(ureadlineu StopIteration(uselfuline((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__next__xs uStreamReader.__next__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__iter__suStreamReader.__iter__cCs||j|S(u? Inherit all other methods from the underlying stream. (ustream(uselfunameugetattr((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __getattr__suStreamReader.__getattr__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __enter__suStreamReader.__enter__cCs|jjdS(N(ustreamuclose(uselfutypeuvalueutb((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__exit__suStreamReader.__exit__NiiFT(u__name__u __module__u __qualname__ustrucharbuffertypeu__init__udecodeuFalseureaduNoneuTrueureadlineu readlinesuresetuseeku__next__u__iter__ugetattru __getattr__u __enter__u__exit__(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyu StreamReadersOK    u StreamReadercBs|EeZdZdZdZdddZd!ddZd d d Zd d d Z d dZ ddZ ddZ ddZ ddZdddZeddZddZddZd S("uStreamReaderWriteru 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. uunknownustrictcCs:||_||||_||||_||_dS(uR 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(ustreamureaderuwriteruerrors(uselfustreamuReaderuWriteruerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__s uStreamReaderWriter.__init__icCs|jj|S(N(ureaderuread(uselfusize((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadsuStreamReaderWriter.readcCs|jj|S(N(ureaderureadline(uselfusize((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadlinesuStreamReaderWriter.readlinecCs|jj|S(N(ureaderu readlines(uselfusizehint((u+/opt/alt/python33/lib64/python3.3/codecs.pyu readlinessuStreamReaderWriter.readlinescCs t|jS(u4 Return the next decoded line from the input stream.(unextureader(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__next__suStreamReaderWriter.__next__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__iter__suStreamReaderWriter.__iter__cCs|jj|S(N(uwriteruwrite(uselfudata((u+/opt/alt/python33/lib64/python3.3/codecs.pyuwritesuStreamReaderWriter.writecCs|jj|S(N(uwriteru writelines(uselfulist((u+/opt/alt/python33/lib64/python3.3/codecs.pyu writelinessuStreamReaderWriter.writelinescCs|jj|jjdS(N(ureaderuresetuwriter(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresets uStreamReaderWriter.reseticCsL|jj|||jj|dkrH|dkrH|jjndS(Ni(ustreamuseekureaderuresetuwriter(uselfuoffsetuwhence((u+/opt/alt/python33/lib64/python3.3/codecs.pyuseeks uStreamReaderWriter.seekcCs||j|S(u? Inherit all other methods from the underlying stream. (ustream(uselfunameugetattr((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __getattr__suStreamReaderWriter.__getattr__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __enter__suStreamReaderWriter.__enter__cCs|jjdS(N(ustreamuclose(uselfutypeuvalueutb((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__exit__suStreamReaderWriter.__exit__Ni(u__name__u __module__u __qualname__u__doc__uencodingu__init__ureaduNoneureadlineu readlinesu__next__u__iter__uwriteu writelinesuresetuseekugetattru __getattr__u __enter__u__exit__(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyuStreamReaderWriters       uStreamReaderWritercBs|EeZdZdZdZdZdddZdddZdd d Z dd d Z d dZ ddZ ddZ ddZddZeddZddZddZdS(u StreamRecoderuE 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. uunknownustrictcCsL||_||_||_||||_||||_||_dS(u 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(ustreamuencodeudecodeureaderuwriteruerrors(uselfustreamuencodeudecodeuReaderuWriteruerrors((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__init__s    uStreamRecoder.__init__icCs1|jj|}|j||j\}}|S(N(ureaderureaduencodeuerrors(uselfusizeudatau bytesencoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadsuStreamRecoder.readcCsO|dkr|jj}n|jj|}|j||j\}}|S(N(uNoneureaderureadlineuencodeuerrors(uselfusizeudatau bytesencoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyureadline%s  uStreamRecoder.readlinecCs:|jj}|j||j\}}|jddS(NukeependsT(ureaderureaduencodeuerrorsu splitlinesuTrue(uselfusizehintudatau bytesencoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyu readlines.suStreamRecoder.readlinescCs.t|j}|j||j\}}|S(u4 Return the next decoded line from the input stream.(unextureaderuencodeuerrors(uselfudatau bytesencoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__next__4suStreamRecoder.__next__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__iter__;suStreamRecoder.__iter__cCs+|j||j\}}|jj|S(N(udecodeuerrorsuwriteruwrite(uselfudatau bytesdecoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyuwrite>suStreamRecoder.writecCs:dj|}|j||j\}}|jj|S(Nu(ujoinudecodeuerrorsuwriteruwrite(uselfulistudatau bytesdecoded((u+/opt/alt/python33/lib64/python3.3/codecs.pyu writelinesCsuStreamRecoder.writelinescCs|jj|jjdS(N(ureaderuresetuwriter(uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyuresetIs uStreamRecoder.resetcCs||j|S(u? Inherit all other methods from the underlying stream. (ustream(uselfunameugetattr((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __getattr__NsuStreamRecoder.__getattr__cCs|S(N((uself((u+/opt/alt/python33/lib64/python3.3/codecs.pyu __enter__UsuStreamRecoder.__enter__cCs|jjdS(N(ustreamuclose(uselfutypeuvalueutb((u+/opt/alt/python33/lib64/python3.3/codecs.pyu__exit__XsuStreamRecoder.__exit__Ni(u__name__u __module__u __qualname__u__doc__u data_encodingu file_encodingu__init__ureaduNoneureadlineu readlinesu__next__u__iter__uwriteu writelinesuresetugetattru __getattr__u __enter__u__exit__(u __locals__((u+/opt/alt/python33/lib64/python3.3/codecs.pyu StreamRecoders        u StreamRecoderurbustricticCs~|dk r%d|kr%|d}ntj|||}|dkrJ|St|}t||j|j|}||_|S(u 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 be 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. ubN(uNoneubuiltinsuopenulookupuStreamReaderWriteru streamreaderu streamwriteruencoding(ufilenameumodeuencodinguerrorsu bufferingufileuinfousrw((u+/opt/alt/python33/lib64/python3.3/codecs.pyuopen]s      cCsj|dkr|}nt|}t|}t||j|j|j|j|}||_||_|S(u 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. N( uNoneulookupu StreamRecoderuencodeudecodeu streamreaderu streamwriteru data_encodingu file_encoding(ufileu data_encodingu file_encodinguerrorsu data_infou file_infousr((u+/opt/alt/python33/lib64/python3.3/codecs.pyu EncodedFiles      cCs t|jS(u Lookup up the codec for the given encoding and return its encoder function. Raises a LookupError in case the encoding cannot be found. (ulookupuencode(uencoding((u+/opt/alt/python33/lib64/python3.3/codecs.pyu getencodersu getencodercCs t|jS(u Lookup up the codec for the given encoding and return its decoder function. Raises a LookupError in case the encoding cannot be found. (ulookupudecode(uencoding((u+/opt/alt/python33/lib64/python3.3/codecs.pyu getdecodersu getdecodercCs.t|j}|dkr*t|n|S(u Lookup up the codec for the given encoding and return its IncrementalEncoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codecs doesn't provide an incremental encoder. N(ulookupuincrementalencoderuNoneu LookupError(uencodinguencoder((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetincrementalencoders  ugetincrementalencodercCs.t|j}|dkr*t|n|S(u Lookup up the codec for the given encoding and return its IncrementalDecoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codecs doesn't provide an incremental decoder. N(ulookupuincrementaldecoderuNoneu LookupError(uencodingudecoder((u+/opt/alt/python33/lib64/python3.3/codecs.pyugetincrementaldecoders  ugetincrementaldecodercCs t|jS(u 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. (ulookupu streamreader(uencoding((u+/opt/alt/python33/lib64/python3.3/codecs.pyu getreadersu getreadercCs t|jS(u 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. (ulookupu streamwriter(uencoding((u+/opt/alt/python33/lib64/python3.3/codecs.pyu getwritersu getwritercksgt|||}x+|D]#}|j|}|r|VqqW|jdd}|rc|VndS(u Encoding iterator. Encodes the input strings from the iterator using a IncrementalEncoder. errors and kwargs are passed through to the IncrementalEncoder constructor. uNT(ugetincrementalencoderuencodeuTrue(uiteratoruencodinguerrorsukwargsuencoderuinputuoutput((u+/opt/alt/python33/lib64/python3.3/codecs.pyu iterencodes   u iterencodecksgt|||}x+|D]#}|j|}|r|VqqW|jdd}|rc|VndS(u Decoding iterator. Decodes the input strings from the iterator using a IncrementalDecoder. errors and kwargs are passed through to the IncrementalDecoder constructor. sNT(ugetincrementaldecoderudecodeuTrue(uiteratoruencodinguerrorsukwargsudecoderuinputuoutput((u+/opt/alt/python33/lib64/python3.3/codecs.pyu iterdecodes   u iterdecodecCsdd|DS(u make_identity_dict(rng) -> dict Return a dictionary where elements of the rng sequence are mapped to themselves. cSsi|]}||qS(((u.0ui((u+/opt/alt/python33/lib64/python3.3/codecs.pyu !s u&make_identity_dict..((urng((u+/opt/alt/python33/lib64/python3.3/codecs.pyumake_identity_dictsumake_identity_dictcCsJi}x=|jD]/\}}||kr8|||s#         A("1+IWt,&