Ñò ‡Tc@@sždZddklZlZlZddkZddkZddklZddk l Z ddk l Z dd„Z dd „Zed jo eƒndS( 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(tabsolute_importtprint_functiontunicode_literalsN(topen(t __version__(tUniversalDetectorustdincC@srtƒ}x|D]}|i|ƒqW|iƒ|i}|dodi||d|dƒSdi|ƒSdS(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 uencodingu{0}: {1} with confidence {2}u confidenceu{0}: no resultN(Rtfeedtclosetresulttformat(tlinestnametutlineR((sJ/usr/lib/python2.6/vendor-packages/requests/packages/chardet/chardetect.pytdescription_ofs     c C@sätidddtiddƒ}|idddd tid ƒd d d tigƒ|iddddditƒƒ|i |ƒ}xW|i D]L}|i ƒo#t dddddti ƒnt t||iƒƒqWdS(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 descriptionuVTakes one or more file paths and reports their detected encodingstformatter_classtconflict_handleruresolveuinputthelpu/File whose encoding we would like to determine.ttypeurbtnargsu*tdefaultu --versiontactionuversiontversionu %(prog)s {0}u0You are running chardetect interactively. Press u8CTRL-D twice at the start of a blank line to signal the u4end of your input. If you want help, run chardetect u--help tfileN(targparsetArgumentParsertArgumentDefaultsHelpFormattert add_argumenttFileTypetsyststdinR Rt parse_argstinputtisattytprinttstderrRR (targvtparsertargstf((sJ/usr/lib/python2.6/vendor-packages/requests/packages/chardet/chardetect.pytmain0s$        u__main__(t__doc__t __future__RRRRRtioRtchardetRtchardet.universaldetectorRRtNoneR)t__name__(((sJ/usr/lib/python2.6/vendor-packages/requests/packages/chardet/chardetect.pyts