ó
    àÅŸg^&  ã                   óê   • S r SSKrSSKrSSKrSSKrSSKrSSKJrJrJ	r	J
r
JrJrJr  SSKJrJr  SSKJrJrJrJrJrJrJrJrJrJr  SSKJr  SrS rS	 r S
 r!S r"S r#S r$S r%S r&S r'S r(SS jr)g)aN  
Usage: humanfriendly [OPTIONS]

Human friendly input/output (text formatting) on the command
line based on the Python package with the same name.

Supported options:

  -c, --run-command

    Execute an external command (given as the positional arguments) and render
    a spinner and timer while the command is running. The exit status of the
    command is propagated.

  --format-table

    Read tabular data from standard input (each line is a row and each
    whitespace separated field is a column), format the data as a table and
    print the resulting table to standard output. See also the --delimiter
    option.

  -d, --delimiter=VALUE

    Change the delimiter used by --format-table to VALUE (a string). By default
    all whitespace is treated as a delimiter.

  -l, --format-length=LENGTH

    Convert a length count (given as the integer or float LENGTH) into a human
    readable string and print that string to standard output.

  -n, --format-number=VALUE

    Format a number (given as the integer or floating point number VALUE) with
    thousands separators and two decimal places (if needed) and print the
    formatted number to standard output.

  -s, --format-size=BYTES

    Convert a byte count (given as the integer BYTES) into a human readable
    string and print that string to standard output.

  -b, --binary

    Change the output of -s, --format-size to use binary multiples of bytes
    (base-2) instead of the default decimal multiples of bytes (base-10).

  -t, --format-timespan=SECONDS

    Convert a number of seconds (given as the floating point number SECONDS)
    into a human readable timespan and print that string to standard output.

  --parse-length=VALUE

    Parse a human readable length (given as the string VALUE) and print the
    number of metres to standard output.

  --parse-size=VALUE

    Parse a human readable data size (given as the string VALUE) and print the
    number of bytes to standard output.

  --demo

    Demonstrate changing the style and color of the terminal font using ANSI
    escape sequences.

  -h, --help

    Show this message and exit.
é    N)ÚTimerÚformat_lengthÚformat_numberÚformat_sizeÚformat_timespanÚparse_lengthÚ
parse_size)Úformat_pretty_tableÚformat_smart_table)
ÚANSI_COLOR_CODESÚANSI_TEXT_STYLESÚHIGHLIGHT_COLORÚ
ansi_stripÚ	ansi_wrapÚenable_ansi_supportÚfind_terminal_sizeÚoutputÚusageÚwarning)ÚSpinner)Údemonstrate_256_colorsÚdemonstrate_ansi_formattingÚmainÚprint_formatted_lengthÚprint_formatted_numberÚprint_formatted_sizeÚprint_formatted_tableÚprint_formatted_timespanÚprint_parsed_lengthÚprint_parsed_sizeÚrun_commandc                  ó8  • [        5          [        R                  " [        R                  SS S/ SQ5      u  p/ nSnSn[        S W  5       5      nU  GH±  u  pxUS;   a  UnM  US	:X  a,  UR                  [        R                  " [        U5      5        MB  US
:X  a,  UR                  [        R                  " [        U5      5        Mt  US;   a,  UR                  [        R                  " [        W5      5        M¦  US;   a,  UR                  [        R                  " [        U5      5        MØ  US;   a-  UR                  [        R                  " [        U5      5        GM  US;   a-  UR                  [        R                  " [         X†5      5        GM>  US:X  a  SnGMI  US;   a-  UR                  [        R                  " ["        U5      5        GM|  US:X  a  UR                  [$        5        GMš  US;   d  GM£  ['        [(        5          g   U(       a*  UR                  [        R                  " [*        U5      5        U(       d  ['        [(        5        gU H
  n	U	" 5         M     g! [         a-  n[        SU5        [        R                  " S5         SnAGN[SnAff = f)z9Command line interface for the ``humanfriendly`` program.é   Nzcd:l:n:s:bt:h)zrun-commandzformat-tablez
delimiter=zformat-length=zformat-number=zformat-size=Úbinaryzformat-timespan=zparse-length=zparse-size=ÚdemoÚhelpz	Error: %sFc              3   ó.   #   • U H  u  pUS ;   v •  M     g7f))z-bz--binaryN© )Ú.0ÚoÚvs      ÚR/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/humanfriendly/cli.pyÚ	<genexpr>Úmain.<locals>.<genexpr>Ž   s   é € Ð=±W©T¨Q�Ð(Ö(²Wùs   ‚)z-dz--delimiterz--parse-sizez--parse-length)z-cz--run-command)z-lz--format-length)z-nz--format-number)z-sz--format-sizez--format-tableT)z-tz--format-timespanz--demo)z-hz--help)r   ÚgetoptÚsysÚargvÚ	Exceptionr   ÚexitÚanyÚappendÚ	functoolsÚpartialr    r   r!   r   r   r   r   r   r   Ú__doc__r   )
ÚoptionsÚ	argumentsÚeÚactionsÚ	delimiterÚshould_format_tabler$   ÚoptionÚvaluer7   s
             r,   r   r      sý  € äÔðÜ#Ÿ]š]¬3¯8©8°A°B¨<¸ò K
ó Ñˆð €GØ€IØÐÜÑ=±WÓ=Ó=€FÜ ‰ˆØÐ*Ó*ØŠIØ�~Ó%Ø�N‰Nœ9×,Ò,Ô->ÀÓFÖGØÐ'Ó'Ø�N‰Nœ9×,Ò,Ô-@À%ÓHÖIØÐ.Ó.Ø�N‰Nœ9×,Ò,¬[¸)ÓDÖEØÐ0Ó0Ø�N‰Nœ9×,Ò,Ô-CÀUÓKÖLØÐ0Ó0Ø�N‰Nœ9×,Ò,Ô-CÀUÓK×LØÐ.Ó.Ø�N‰Nœ9×,Ò,Ô-AÀ5ÓQ×RØÐ'Ó'Ø"&ÓØÐ2Ó2Ø�N‰Nœ9×,Ò,Ô-EÀuÓM×NØ�xÓØ�N‰NÔ6×7ØÐ'Ö'Ü”'ŒNÙñ/ !ö0 Ø�‰”y×(Ò(Ô)>À	ÓJÔKÞÜŒgŒØÛˆÙŽ	ò øôI ó Ü�˜QÔÜ�Š��Šûðús   Œ-I" É"
JÉ,"JÊJc                 óŒ  • [        5       nSSR                  [        [        R                  U 5      5      -  n[        X!S9 n[        R                  " U 5      n UR                  5         UR                  5         UR                  5       b  OM4  SSS5        [        R                  " WR                  5        g! , (       d  f       N/= f)zHRun an external command and show a spinner while the command is running.zWaiting for command: %sÚ )ÚlabelÚtimerN)r   ÚjoinÚmapÚpipesÚquoter   Ú
subprocessÚPopenÚstepÚsleepÚpollr0   r3   Ú
returncode)Úcommand_linerD   Úspinner_labelÚspinnerÚprocesss        r,   r!   r!   °   sŒ   € ä‹G€EØ-°·±¼¼U¿[¹[È,Ó9WÓ0XÑX€MÜ	�}Ò	2°gÜ×"Ò" <Ó0ˆØØ�L‰LŒNØ�M‰MŒOØ�|‰|‹~Ñ)Øñ	 ÷ 
3ô ‡H‚HˆW×ÑÕ ÷ 
3Õ	2ús   Á AB5Â5
Cc                 ó†   • SU ;   a  [        [        [        U 5      5      5        g[        [        [        U 5      5      5        g)zPrint a human readable length.Ú.N)r   r   ÚfloatÚint©r@   s    r,   r   r   ¾   s+   € à
ˆeƒ|ÜŒ}œU 5›\Ó*Õ+äŒ}œS ›ZÓ(Õ)ó    c                 ó>   • [        [        [        U 5      5      5        g)z/Print large numbers in a human readable format.N)r   r   rU   rW   s    r,   r   r   Æ   s   € ä
Œ=œ˜u›Ó&Õ'rX   c                 ó<   • [        [        [        U 5      US95        g)zPrint a human readable size.)r$   N)r   r   rV   )r@   r$   s     r,   r   r   Ë   s   € ä
Œ;”s˜5“z¨&Ñ1Õ2rX   c                 ó¾   • / n[         R                   H3  nUR                  5       nUR                  UR	                  U 5      5        M5     [        [        U5      5        g)z8Read tabular data from standard input and print a table.N)r0   ÚstdinÚrstripr5   Úsplitr   r
   )r=   ÚdataÚlines      r,   r   r   Ð   sE   € à€DÜ—	”	ˆØ�{‰{‹}ˆØ�‰�D—J‘J˜yÓ)Ö*ñ ô Ô˜tÓ$Õ%rX   c                 ó>   • [        [        [        U 5      5      5        g)z Print a human readable timespan.N)r   r   rU   rW   s    r,   r   r   Ù   s   € ä
Œ?œ5 ›<Ó(Õ)rX   c                 ó,   • [        [        U 5      5        g)z=Parse a human readable length and print the number of metres.N)r   r   rW   s    r,   r   r   Þ   s   € ä
Œ<˜ÓÕrX   c                 ó,   • [        [        U 5      5        g)z?Parse a human readable data size and print the number of bytes.N)r   r	   rW   s    r,   r    r    ã   s   € ä
Œ:�eÓÕrX   c                  óô  • [        S[        SSS95        SS/n U R                  [        R                  " 5       5        [        U 5       HP  n[        [        S9nUS:w  a  SX!'   UR                  SS	5      R                  5       n[        S
[        U40 UD65        MR     S GH  u  pES[        5       4S[        SS94/nUS:w  a  UR                  SS[        SS945        [        S[        SU-  SS9-  5        [        [        [        [        R                  " 5       5       VVV	s/ sHT  nU/U VV	s/ sH>  u  p‰[        US:w  a  SOS40 [        [        U	R                  5       5      XG4/-   5      D6PM@     sn	n-   PMV     sn	nnS/U VV	s/ sH  u  p‰UR                  5       PM     sn	n-   S95        GM     [        SSS5        [        SSS5        [        SSS5        [        SS S!5        g"s  sn	nf s  sn	nnf s  sn	nf )#z-Demonstrate the use of ANSI escape sequences.z%szText styles:T©ÚboldÚnormalÚbright©ÚcolorÚ_rB   z - %s))rj   zForeground colors)Ú
backgroundzBackground colors)rh   rl   r   Úfaint)rm   z
%sú%s:ÚXXXXXXz      ÚColor)Úcolumn_namesé   zstandard colorsé   é   zhigh-intensity colorsé   éç   z
216 colorséè   éÿ   zgray scale colorsN)r   r   Úextendr   ÚkeysÚsortedÚdictr   ÚreplaceÚ
capitalizeÚinsertr   r   ÚlistÚitemsr   )
ÚstylesÚ
style_namer9   Ústyle_labelÚ
color_typeÚcolor_labelÚintensitiesÚ
color_namerC   Úkws
             r,   r   r   è   s  € ô ˆ4”˜>°Ñ5Ô6Ø˜Ð!€FØ
‡M�MÔ"×'Ò'Ó)Ô*Ü˜V–nˆ
Üœ_Ñ-ˆØ˜Ó!Ø"&ˆGÑØ ×(Ñ(¨¨cÓ2×=Ñ=Ó?ˆÜˆwœ	 +Ñ9°Ñ9Ö:ñ %ô$IÑˆ
ð ”t“vÐØ”t 4Ñ(Ð)ð
ˆð ˜Ó%Ø×Ñ˜q 7¬D°tÑ,<Ð"=Ô>Üˆvœ	 %¨+Ñ"5¸DÑAÑAÔBÜÔ!ô !'Ô'7×'<Ò'<Ó'>Ô ?õ#
ñ !@�*ð ˆLñ $/ô	ñ $/‘i�eô Ø *¨lÓ :‘HÀñäœ4 §¡£
Ó+°
Ð/GÐ.HÑHÓIôñ $/ò	ô ñ
 !@ó#
ð !˜	Ù0;ô%
Ù0;¡9 5ˆE×ÑÖ±ò%
ñ 
ñ	÷ 		ñ$Iô( ˜1˜aÐ!2Ô3Ü˜1˜bÐ"9Ô:Ü˜2˜s LÔ1Ü˜3 Ð%8Õ9ùóùô#
ùó%
s   Ä!G-Ä-AG'Å1
G-ÆG4Ç'G-c                 ój  • SnU(       a  USU-  -  n[        S[        SU-  SS9-   5        SR                  S [        XS	-   5       5       5      n[	        5       u  pVU[        [        U5      5      :¼  a  [        U5        g[        [        U5      5      S	-   n[        Xg-  5      n[        XS	-   5       V	s/ sH%  n	[        [        U	5      R                  U5      U	S
9PM'     n
n	[        S[        U
5      U5       V	s/ sH	  ošX™U-    PM     nn	[        SR                  S U 5       5      5        gs  sn	f s  sn	f )z#Demonstrate 256 color mode support.z256 color modez (%s)Ú
rn   Tre   Ú c              3   óL   #   • U H  nS [        [        U5      US9-   v •  M     g7f)rB   ri   N)r   Ústr)r)   Úns     r,   r-   Ú)demonstrate_256_colors.<locals>.<genexpr>  s    é € ÐTÁO¸q˜#¤	¬#¨a«&¸Ñ :Ö:ÂOùs   ‚"$r#   ri   r   c              3   óB   #   • U H  nS R                  U5      v •  M     g7f)rŒ   N)rE   )r)   Úbs     r,   r-   r�   #  s   é € Ð4©V¨˜Ÿ™ Ÿ˜ªVùs   ‚N)
r   r   rE   Úranger   Úlenr   rŽ   rV   Úrjust)ÚiÚjÚgrouprC   Úsingle_lineÚlinesÚcolumnsÚwidthÚcolors_per_liner�   ÚcolorsÚblockss               r,   r   r     s  € ð €EÞØ�˜5‘Ñ ˆÜ
ˆ4”)˜E E™M°Ñ5Ñ5Ô6ð —'‘'ÑTÄEÈ!ÐQRÉUÄOÓTÓT€KÜ'Ó)�N€EØ”#”j Ó-Ó.Ó.Üˆ{Õô ”C˜“F“˜a‘ˆÜ˜g™oÓ.ˆÜCHÈÐPQÉEÄ?ÓSÁ?¸a”)œC ›FŸL™L¨Ó/°qÔ9Á?ˆÐSÜ9>¸qÄ#ÀfÃ+ÈÔ9_Ó`Ñ9_°A˜˜Ñ.Ó/Ñ9_ˆÐ`Üˆt�y‰yÑ4©VÓ4Ó4Õ5ùò TùÚ`s   Â3+D+Ã8D0)N)*r8   r6   r/   rG   rI   r0   Úhumanfriendlyr   r   r   r   r   r   r	   Úhumanfriendly.tablesr
   r   Úhumanfriendly.terminalr   r   r   r   r   r   r   r   r   r   Úhumanfriendly.terminal.spinnersr   Ú__all__r   r!   r   r   r   r   r   r   r    r   r   r(   rX   r,   Ú<module>r¥      s†   ðñFóR Û Û Û Û 
÷÷ ñ ÷ I÷÷ ÷ õ 4ð€ò.òb!ò*ò(ò
3ò
&ò*ò
 ò
ò
$:õN6rX   