ó
è¾bc           @   s¤   d  Z  d d l Z d d l Z e j Z d d „ Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d	 e j	 f d
 „  ƒ  YZ	 d e j
 f d „  ƒ  YZ
 d „  Z d S(   s   
Python 'utf-32' Codec
iÿÿÿÿNt   strictc         C   s   t  j |  | t ƒ S(   N(   t   codecst   utf_32_decodet   True(   t   inputt   errors(    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   decode
   s    t   IncrementalEncoderc           B   s;   e  Z d  d „ Z e d „ Z d „  Z d „  Z d „  Z RS(   R    c         C   s    t  j j |  | ƒ d  |  _ d  S(   N(   R   R   t   __init__t   Nonet   encoder(   t   selfR   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR      s    c         C   sm   |  j  d  k rV t j | |  j ƒ d } t j d k rF t j |  _  n t j |  _  | S|  j  | |  j ƒ d S(   Ni    t   little(	   R
   R	   R   t   utf_32_encodeR   t   syst	   byteordert   utf_32_le_encodet   utf_32_be_encode(   R   R   t   finalt   result(    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   encode   s    c         C   s   t  j j |  ƒ d  |  _ d  S(   N(   R   R   t   resetR	   R
   (   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR      s    c         C   s   |  j  d  k r d Sd S(   Ni   i    (   R
   R	   (   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   getstate    s    c         C   s@   | r d  |  _ n* t j d k r0 t j |  _ n t j |  _ d  S(   NR   (   R	   R
   R   R   R   R   R   (   R   t   state(    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   setstate'   s
    (   t   __name__t
   __module__R   t   FalseR   R   R   R   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR      s
   
		t   IncrementalDecoderc           B   s8   e  Z d  d „ Z d „  Z d „  Z d „  Z d „  Z RS(   R    c         C   s    t  j j |  | ƒ d  |  _ d  S(   N(   R   t   BufferedIncrementalDecoderR   R	   t   decoder(   R   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   1   s    c         C   s¡   |  j  d  k r‹ t j | | d | ƒ \ } } } | d k rK t j |  _  n6 | d k rf t j |  _  n | d k r t d ƒ ‚ n  | | f S|  j  | |  j | ƒ S(   Ni    iÿÿÿÿi   i   s%   UTF-32 stream does not start with BOM(   R   R	   R   t   utf_32_ex_decodet   utf_32_le_decodet   utf_32_be_decodet   UnicodeErrorR   (   R   R   R   R   t   outputt   consumedR   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   _buffer_decode5   s    !
c         C   s   t  j j |  ƒ d  |  _ d  S(   N(   R   R   R   R	   R   (   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   B   s    c         C   s`   t  j j |  ƒ d } |  j d  k r/ | d f St t j d k |  j t  j k k ƒ } | | f S(   Ni    i   t   big(	   R   R   R   R   R	   t   intR   R   R!   (   R   R   t   addstate(    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   F   s    
c         C   s   t  j j |  | ƒ | d } | d k rP t j d k rA t  j n t  j |  _ n< | d k rƒ t j d k rt t  j n t  j |  _ n	 d  |  _ d  S(   Ni   i    R&   (	   R   R   R   R   R   R!   R    R   R	   (   R   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   T   s    
(   R   R   R   R%   R   R   R   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   0   s
   			t   StreamWriterc           B   s)   e  Z d  d „ Z d „  Z d  d „ Z RS(   R    c         C   s#   d  |  _ t j j |  | | ƒ d  S(   N(   R	   R
   R   R)   R   (   R   t   streamR   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   d   s    	c         C   s   t  j j |  ƒ d  |  _ d  S(   N(   R   R)   R   R	   R
   (   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   h   s    c         C   sc   |  j  d  k rO t j | | ƒ } t j d k r? t j |  _  n t j |  _  | S|  j  | | ƒ Sd  S(   NR   (   R
   R	   R   R   R   R   R   R   (   R   R   R   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   l   s    (   R   R   R   R   R   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR)   c   s   	t   StreamReaderc           B   s   e  Z d  „  Z d d „ Z RS(   c         C   s2   t  j j |  ƒ y
 |  ` Wn t k
 r- n Xd  S(   N(   R   R+   R   R   t   AttributeError(   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   y   s
    
R    c         C   sy   t  j | | d t ƒ \ } } } | d k r< t  j |  _ n3 | d k rW t  j |  _ n | d k ro t d ‚ n  | | f S(   Ni    iÿÿÿÿi   i   s%   UTF-32 stream does not start with BOM(   R   R   R   R    R   R!   R"   (   R   R   R   t   objectR$   R   (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR   €   s    !(   R   R   R   R   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyR+   w   s   	c           C   s4   t  j d d d t d t d t d t d t d t ƒ S(	   Nt   names   utf-32R   R   t   incrementalencodert   incrementaldecodert   streamreadert   streamwriter(   R   t	   CodecInfoR   R   R   R   R+   R)   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   getregentry   s    	(   t   __doc__R   R   R   R   R   R   R   R   R)   R+   R4   (    (    (    s&   /usr/lib/python2.7/encodings/utf_32.pyt   <module>   s   	#3