ok
Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/chardet/ |
Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/chardet/chardetect.pyo |
� ��L]c @ sk d Z d d l m Z d d l m Z m Z d d l m Z d d � Z d � Z e d k rg e � n d S( s Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. i����( t open( t argvt stdin( t UniversalDetectorR c C si t � } x | D] } | j | � q W| j � | j } | d r] d | | d | d f Sd | Sd S( s; Return a string describing the probable encoding of a file.t encodings %s: %s with confidence %st confidences %s: no resultN( R t feedt closet result( t filet namet ut lineR ( ( s6 /usr/lib/python2.7/site-packages/chardet/chardetect.pyt description_of s c C s_ t t � d k r t t � GHn; x8 t d D], } t | d � � } t | | � GHWd QXq+ Wd S( Ni t rb( t lenR R R R ( t patht f( ( s6 /usr/lib/python2.7/site-packages/chardet/chardetect.pyt main# s t __main__N( t __doc__t ioR t sysR R t chardet.universaldetectorR R R t __name__( ( ( s6 /usr/lib/python2.7/site-packages/chardet/chardetect.pyt <module> s