7ec@sdZddlZddZddZdejfdYZdejfd YZd ejfd YZd ejfd YZdZ dS(s 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. iNtstrictcCs'tjtj||dt|fS(Ni(tcodecstBOM_UTF8t utf_8_encodetlen(tinputterrors((s+/usr/lib64/python2.7/encodings/utf_8_sig.pytencodescCsUd}|d tjkr,|d}d}ntj||t\}}|||fS(Nii(RRt utf_8_decodetTrue(RRtprefixtoutputtconsumed((s+/usr/lib64/python2.7/encodings/utf_8_sig.pytdecodes   tIncrementalEncodercBs;eZddZedZdZdZdZRS(RcCs tjj||d|_dS(Ni(RRt__init__tfirst(tselfR((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRscCsK|jr0d|_tjtj||jdStj||jdSdS(Ni(RRRRR(RRtfinal((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRs  cCstjj|d|_dS(Ni(RRtresetR(R((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyR%scCs|jS(N(R(R((s+/usr/lib64/python2.7/encodings/utf_8_sig.pytgetstate)scCs ||_dS(N(R(Rtstate((s+/usr/lib64/python2.7/encodings/utf_8_sig.pytsetstate,s(t__name__t __module__RtFalseRRRR(((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRs     tIncrementalDecodercBs&eZddZdZdZRS(RcCs tjj||t|_dS(N(RtBufferedIncrementalDecoderRR R(RR((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyR0scCs|jrt|dkr=tjj|r1dSd|_qd|_|d tjkrtj|d||\}}||dfSntj|||S(Niui(ui(RRRRt startswithtNoneR(RRRRR R ((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyt_buffer_decode4s   cCstjj|t|_dS(N(RRRR R(R((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRDs(RRRRR(((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyR/s  t StreamWritercBseZdZddZRS(cCs2tjj|y |`Wntk r-nXdS(N(RRRRtAttributeError(R((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRIs   RcCstj|_t||S(N(RRR(RRR((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRPs (RRRR(((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRHs t StreamReadercBseZdZddZRS(cCs2tjj|y |`Wntk r-nXdS(N(RR!RR R (R((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyRUs   RcCst|dkr+tjj|rtdSnI|d tjkrttj|_tj|d|\}}||dfStj|_tj||S(Niui(ui(RRRRRR (RRRR R ((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyR \s  (RRRR (((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyR!Ts cCs4tjdddtdtdtdtdtdtS( Ntnames utf-8-sigRR tincrementalencodertincrementaldecodert streamreadert streamwriter(Rt CodecInfoRR RRR!R(((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyt getregentryls ( t__doc__RRR RRRRR!R((((s+/usr/lib64/python2.7/encodings/utf_8_sig.pyt s