#<${ d Z ddlZddlZddlmZmZmZ ddlmZ ddl m
Z
dd ee d
ede
de
d
ee f
dZddeee d
dfdZedk r e dS dS )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.
N)IterableListOptional )__version__)UniversalDetectorstdinFlinesnameminimalshould_rename_legacyreturnc t | }| D ]/}t | }| | |j r n0| |j }|r|d S |d r| d|d d|d S | dS )a
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
:param should_rename_legacy: Should we rename legacy encodings to
their more modern equivalents?
:type should_rename_legacy: ``bool``
)r
encodingz: z with confidence
confidencez: no result)r bytearrayfeeddonecloseresult)r
r r r
uliner s h/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/chardet/cli/chardetect.pydescription_ofr s $ /CDDDA t6 E GGIII
XF "j!!
j VUU&,UUvl?SUUU argvc D t j d }| ddt j d dt j j g | dd d
| dd
dd
| dddt | | }|j D ]`}|
rt dt j t t ||j |j |j adS )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
zATakes one or more file paths and reports their detected encodings)descriptioninputz@File whose encoding we would like to determine. (default: stdin)rb*)helptypenargsdefaultz --minimalz*Print only the encoding to standard output
store_true)r" actionz-lz--legacyz,Rename legacy encodings to more modern ones.z --versionversionz %(prog)s )r' r( 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
)file)r r
N)argparseArgumentParseradd_argumentFileTypesysr bufferr
parse_argsr isattyprintstderrr r r legacy)r parserargsfs r mainr8 : s~
$O F
O
t
$
$!"
9
; I/H;/H/H T""D
Z
88:: Z
164