Re dZddlmZmZmZddlZddlZddlmZddl m Z ddl m Z d dZ d d Zed kr edSdS) a 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. )absolute_importprint_functionunicode_literalsN) __version__)PY2)UniversalDetectorstdinct}|D]/}t|}|||jrn0||j}t r'|tj d}|dr#d ||d|dSd |S)z 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 ignoreencodingz{}: {} with confidence {} confidencez {}: no result) r bytearrayfeeddonecloseresultrdecodesysgetfilesystemencodingformat)linesnameuliners /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/chardet/cli/chardetect.pydescription_ofrs A t 6  E GGIII XF B{{3466AA j,*11$z8J5;L5IKK K%%d+++ctjd}|ddtjddtr t jnt jjg|dd d t | |}|j D]S}| rtd t j tt||jTdS)z 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 zVTakes one or more file paths and reports their detected encodings) descriptioninputz^File whose encoding we would like to determine. (default: stdin)rb*)helptypenargsdefaultz --versionversionz %(prog)s {})actionr'zYou are running chardetect interactively. Press CTRL-D twice at the start of a blank line to signal the end of your input. If you want help, run chardetect --help )fileN)argparseArgumentParser add_argumentFileTyperrr bufferrr parse_argsr isattyprintstderrrr)argvparserargsfs rmainr75s& $ !!!F 0%.t44C.1!Gsy7G H JJJ   I - 4 4[ A ACCC   T " "D Z)) 88:: / $': / / / / nQ''(((( ))r__main__)r )N)__doc__ __future__rrrr*rpip._vendor.chardetrpip._vendor.chardet.compatr%pip._vendor.chardet.universaldetectorrrr7__name__rrr@s  IHHHHHHHHH ++++++******CCCCCC,,,,8))))< zDFFFFFr