Žĸf% c @ sĪ d Z d d l Z d d d Z d d d Z Gd d d e j Z Gd
d d e j Z Gd d
d
e j Z Gd d d e j Z d d Z d S( u Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:
* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
first three bytes.
* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
bytes will be skipped.
i Nu strictc C s' t j t j | | d t | f S( Ni ( u codecsu BOM_UTF8u utf_8_encodeu len( u inputu errors( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu encode s u encodec C sa d } | d d
t j k r8 | d d
} d } n t j | | d \ } } | | | f S( Ni i T( u codecsu BOM_UTF8u utf_8_decodeu True( u inputu errorsu prefixu outputu consumed( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu decode s u decodec B sV | Ee Z d Z d d d Z d
d d Z d d Z d d Z d
d Z d S( u IncrementalEncoderu strictc C s t j j | | d | _ d S( Ni ( u codecsu IncrementalEncoderu __init__u first( u selfu errors( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu __init__ s u IncrementalEncoder.__init__c C sK | j r0 d | _ t j t j | | j d St j | | j d Sd S( Ni ( u firstu codecsu BOM_UTF8u utf_8_encodeu errors( u selfu inputu final( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu encode s
u IncrementalEncoder.encodec C s t j j | d | _ d S( Ni ( u codecsu IncrementalEncoderu resetu first( u self( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu reset' s u IncrementalEncoder.resetc C s | j S( N( u first( u self( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu getstate+ s u IncrementalEncoder.getstatec C s
| | _ d S( N( u first( u selfu state( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu setstate. s u IncrementalEncoder.setstateNF( u __name__u
__module__u __qualname__u __init__u Falseu encodeu resetu getstateu setstate( u
__locals__( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu IncrementalEncoder s
u IncrementalEncoderc B sS | Ee Z d Z d d d Z d d Z d d Z d d Z d
d Z d S(
u IncrementalDecoderu strictc C s t j j | | d | _ d S( Ni ( u codecsu BufferedIncrementalDecoderu __init__u first( u selfu errors( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu __init__2 s u IncrementalDecoder.__init__c C sĻ | j r t | d k r= t j j | r1 d Sd | _ q d | _ | d d
t j k r t j | d d
| | \ } } | | d f Sn t j | | | S( Ni u i ( u i ( u firstu lenu codecsu BOM_UTF8u
startswithu utf_8_decode( u selfu inputu errorsu finalu outputu consumed( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu _buffer_decode6 s %u! IncrementalDecoder._buffer_decodec C s t j j | d | _ d S( Ni ( u codecsu BufferedIncrementalDecoderu resetu first( u self( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu resetG s u IncrementalDecoder.resetc C s# t j j | } | d | j f S( Ni ( u codecsu BufferedIncrementalDecoderu getstateu first( u selfu state( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu getstateK s u IncrementalDecoder.getstatec C s$ t j j | | | d | _ d S( Ni ( u codecsu BufferedIncrementalDecoderu setstateu first( u selfu state( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu setstateP s u IncrementalDecoder.setstateN( u __name__u
__module__u __qualname__u __init__u _buffer_decodeu resetu getstateu setstate( u
__locals__( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu IncrementalDecoder1 s
u IncrementalDecoderc B s/ | Ee Z d Z d d Z d d d Z d S( u StreamWriterc C s3 t j j | y
| ` Wn t k
r. Yn Xd S( N( u codecsu StreamWriteru resetu encodeu AttributeError( u self( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu resetV s
u StreamWriter.resetu strictc C s t j | _ t | | S( N( u codecsu utf_8_encodeu encode( u selfu inputu errors( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu encode] s u StreamWriter.encodeN( u __name__u
__module__u __qualname__u resetu encode( u
__locals__( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu StreamWriterU s u StreamWriterc B s/ | Ee Z d Z d d Z d d d Z d S( u StreamReaderc C s3 t j j | y
| ` Wn t k
r. Yn Xd S( N( u codecsu StreamReaderu resetu decodeu AttributeError( u self( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu resetb s
u StreamReader.resetu strictc C s t | d k r+ t j j | r d SnU | d d
t j k r t j | _ t j | d d
| \ } } | | d f St j | _ t j | | S( Ni u i ( u i ( u lenu codecsu BOM_UTF8u
startswithu utf_8_decodeu decode( u selfu inputu errorsu outputu consumed( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu decodei s "u StreamReader.decodeN( u __name__u
__module__u __qualname__u resetu decode( u
__locals__( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu StreamReadera s u StreamReaderc C s4 t j d d d t d t d t d t d t d t S( Nu nameu utf-8-sigu encodeu decodeu incrementalencoderu incrementaldecoderu streamreaderu streamwriter( u codecsu CodecInfou encodeu decodeu IncrementalEncoderu IncrementalDecoderu StreamReaderu StreamWriter( ( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu getregentryy s u getregentry(
u __doc__u codecsu encodeu decodeu IncrementalEncoderu BufferedIncrementalDecoderu IncrementalDecoderu StreamWriteru StreamReaderu getregentry( ( ( u8 /opt/alt/python33/lib64/python3.3/encodings/utf_8_sig.pyu