관리-도구
편집 파일: universaldetector.cpython-33.pyc
� 7�Re� c @ s� d d l m Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l Z d Z d Z d Z d Z Gd d � d � Z d S( i ( u constantsi N( u Latin1Prober( u MBCSGroupProber( u SBCSGroupProber( u EscCharSetProberg�������?i c B sD | Ee Z d Z d d � Z d d � Z d d � Z d d � Z d S( u UniversalDetectorc C sD t j d � | _ t j d � | _ d | _ g | _ | j � d S( Ns [�-�]s (|~{)( u reu compileu _highBitDetectoru _escDetectoru Noneu _mEscCharSetProberu _mCharSetProbersu reset( u self( ( uP /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/universaldetector.pyu __init__- s u UniversalDetector.__init__c C s i d d 6d d 6| _ d | _ d | _ d | _ t | _ d | _ | j r] | j j � n x | j D] } | j � qg Wd S( Nu encodingg u confidences FT( u Noneu resultu Falseu doneu Trueu _mStartu _mGotDatau ePureAsciiu _mInputStateu _mLastCharu _mEscCharSetProberu resetu _mCharSetProbers( u selfu prober( ( uP /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/universaldetector.pyu reset4 s u UniversalDetector.resetc C sN | j r d St | � } | s# d S| j s�| d d � t j k r_ i d d 6d d 6| _ q�| d d � t j k r� i d d 6d d 6| _ q�| d d � t j k r� i d d 6d d 6| _ q�| d d � d k r� i d d 6d d 6| _ q�| d d � d k r%i d d 6d d 6| _ q�| d d � t j k rXi d d 6d d 6| _ q�| d d � t j k r�i d d 6d d 6| _ q�n d | _ | j d r�| j d d k r�d | _ d S| j t k r(| j j | � r�t | _ q(| j t k r(| j j | j | � r(t | _ q(n | d d � | _ | j t k r�| j sbt � | _ n | j j | � t j k rJi | j j � d 6| j j � d 6| _ d | _ qJn� | j t k rJ| j s�t � t � t � g | _ n x\ | j D]N } | j | � t j k r�i | j � d 6| j � d 6| _ d | _ Pq�q�Wn d S( Ni u UTF-8u encodingg �?u confidencei u UTF-32LEu UTF-32BEs �� u X-ISO-10646-UCS-4-3412s ��u X-ISO-10646-UCS-4-2143i u UTF-16LEu UTF-16BEg i Ti����( u doneu lenu _mGotDatau codecsu BOMu resultu BOM_UTF32_LEu BOM_UTF32_BEu BOM_LEu BOM_BEu Trueu _mInputStateu ePureAsciiu _highBitDetectoru searchu eHighbyteu _escDetectoru _mLastCharu eEscAsciiu _mEscCharSetProberu EscCharSetProberu feedu constantsu eFoundItu get_charset_nameu get_confidenceu _mCharSetProbersu MBCSGroupProberu SBCSGroupProberu Latin1Prober( u selfu aBufu aLenu prober( ( uP /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/universaldetector.pyu feed@ sh u UniversalDetector.feedc C s� | j r d S| j s6 t j r2 t j j d � n d Sd | _ | j t k rl i d d 6d d 6| _ | j S| j t k rd } d } d } xD | j D]9 } | s� q� n | j � } | | k r� | } | } q� q� W| r| t k ri | j � d 6| j � d 6| _ | j Sn t j r|t j j d � xM | j d j D]8 } | sOq=n t j j d | j � | j � f � q=Wn d S( Nu no data received! u asciiu encodingg �?u confidenceg u"