/opt/alt/python27/lib/python2.7/site-packages/chardet
Edit: /opt/alt/python27/lib/python2.7/site-packages/chardet/chardetect.pyo (3010B)
ó
“l-Xc @@ sœ d Z d d l m Z m Z 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 „ Z
d d „ Z e d
k r˜ e ƒ n d S( u
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 absolute_importt print_functiont unicode_literalsN( t open( t __version__( t UniversalDetectoru stdinc C@ sp t ƒ } x | D] } | j | ƒ q W| j ƒ | j } | d r_ d j | | d | d ƒ Sd j | ƒ Sd S( uý
Return a string describing the probable encoding of a file or
list of strings.
:param lines: The lines to get the encoding of.
:type lines: Iterable of bytes
:param name: Name of file or collection of lines
:type name: str
u encodingu {0}: {1} with confidence {2}u
confidenceu {0}: no resultN( R t feedt closet resultt format( t linest namet ut lineR ( ( sC /opt/alt/python27/lib/python2.7/site-packages/chardet/chardetect.pyt description_of s
c
C@ sâ t j d d d t j d d ƒ } | j d d d d t j d
ƒ d d d
t j g ƒ| j d d d d d j t ƒ ƒ| j | ƒ } xU | j
D]J } | j ƒ rÄ t d d d d d t j
ƒn t t | | j ƒ ƒ q Wd S( uã
Handles command line arguments and gets things started.
:param argv: List of arguments, as if specified on the command-line.
If None, ``sys.argv[1:]`` is used instead.
:type argv: list of str
t descriptionuV Takes one or more file paths and reports their detected encodingst formatter_classt conflict_handleru resolveu inputt helpu/ File whose encoding we would like to determine.t typeu rbt nargsu *t defaultu --versiont actionu versiont versionu %(prog)s {0}u0 You are running chardetect interactively. Press u8 CTRL-D twice at the start of a blank line to signal the u4 end of your input. If you want help, run chardetect u --help
t fileN( t argparset ArgumentParsert ArgumentDefaultsHelpFormattert add_argumentt FileTypet syst stdinR R t
parse_argst inputt isattyt printt stderrR R ( t argvt parsert argst f( ( sC /opt/alt/python27/lib/python2.7/site-packages/chardet/chardetect.pyt main/ s"
u __main__( t __doc__t
__future__R R R R R t ioR t chardetR t chardet.universaldetectorR R t NoneR) t __name__( ( ( sC /opt/alt/python27/lib/python2.7/site-packages/chardet/chardetect.pyt
s