%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/click/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/click/__pycache__/formatting.cpython-312.pyc

�

D�d�%�
���UddlZddlmZddlmZddlmZddlm	Z	dZ
ejee
d<dejejeefd	ejed
ffd�Zdejejeefded	ej$ejed
ffd
�Z				ddededededed	efd�ZGd�d�Zdej.ed	ejeeffd�Zy)�N)�contextmanager)�gettext�)�term_len)�	split_opt�FORCED_WIDTH�rows�return.c���i}|D]=}t|�D]-\}}t|j|d�t|��||<�/�?t	d�t|j
��D��S)Nrc3�&K�|]	\}}|���y�w)N�)�.0�x�ys   �2/usr/lib/python3/dist-packages/click/formatting.py�	<genexpr>z measure_table.<locals>.<genexpr>s����6�t�q�!��6���)�	enumerate�max�getr�tuple�sorted�items)r	�widths�row�idx�cols     r�
measure_tablersn��!�F��A��!�#��	A�H�C���f�j�j��a�0�(�3�-�@�F�3�K�	A�A��6�v�f�l�l�n�5�6�6�6��	col_countc#�FK�|D]}|d|t|�z
zz���y�w)N)�)�len)r	r rs   r�	iter_rowsr$s0�����3���E�Y��S��1�2�2�2�3�s�!�text�width�initial_indent�subsequent_indent�preserve_paragraphsc�j��
��ddlm}|j�}||||d��}|s|j|�Sg�g�d�
d	��
�fd�}|j	�D]J}|s
|�d�
��
�)t|�}	|j
�}|	t|�z
�
�j|��L|�g}
�D]f\�
}}|jd�
z�5|r!|
j|j|��n |
j|j|��ddd��hdj|
�S#1swY��xYw)
a�A helper function that intelligently wraps text.  By default, it
    assumes that it operates on a single paragraph of text but if the
    `preserve_paragraphs` parameter is provided it will intelligently
    handle paragraphs (defined by two empty lines).

    If paragraphs are handled, a paragraph can be prefixed with an empty
    line containing the ``\b`` character (``\x08``) to indicate that
    no rewrapping should happen in that block.

    :param text: the text that should be rewrapped.
    :param width: the maximum width for the text.
    :param initial_indent: the initial indent that should be placed on the
                           first line as a string.
    :param subsequent_indent: the indent string that should be placed on
                              each consecutive line.
    :param preserve_paragraphs: if this flag is set then the wrapping will
                                intelligently handle paragraphs.
    r)�TextWrapperF)r'r(�replace_whitespaceNc	�����sy�dj�dk(r+�j�xsdddj�dd�f�n'�j�xsdddj��f��dd�=y)Nr�T�
rF� )�strip�append�join)�buf�indent�ps���r�
_flush_parzwrap_text.<locals>._flush_parFsg������q�6�<�<�>�T�!�
�H�H�f�k��4����3�q�r�7�);�<�=�
�H�H�f�k��5�#�(�(�3�-�8�9���Frr0z

�r
N)�	_textwrapr+�
expandtabs�fill�
splitlinesr�lstripr2�extra_indent�indent_onlyr3)r%r&r'r(r)r+�wrapperr7�line�orig_len�rv�rawr4r5r6s            @@@r�	wrap_textrEs7���2'��?�?��D��
�%�+� �	�G���|�|�D�!�!�)+�A��C�
�F�����!�	����L��F��~�#�D�>���{�{�}��!�H�T�N�2���J�J�t��	��L�	�B��.����T�
�
!�
!�#��,�
/�	.���	�	�'�-�-�d�3�4��	�	�'�,�,�t�,�-�		.�	.�.��;�;�r�?��
	.�	.�s
�
AD)�)D2	c	��eZdZdZ			ddedejedejeddfd�Zdeddfd	�Z	dd
�Z
dd�Z	dded
edejeddfd�Zdeddfd�Z
dd�Zdeddfd�Z		d dej ej"eefdededdfd�Zededej(dfd��Zedej(dfd��Zdefd�Zy)!�
HelpFormattera�This class helps with formatting text-based help pages.  It's
    usually just needed for very special internal cases, but it's also
    exposed so that developers can write their own fancy outputs.

    At present, it always writes into memory.

    :param indent_increment: the additional increment for each level.
    :param width: the width for the text.  This defaults to the terminal
                  width clamped to a maximum of 78.
    N�indent_incrementr&�	max_widthr
c���ddl}||_|�d}|�9t}|�1tt	|j�j|�dz
d�}||_d|_g|_	y)Nr�P��2)
�shutilrHrr�min�get_terminal_size�columnsr&�current_indent�buffer)�selfrHr&rIrNs     r�__init__zHelpFormatter.__init__rsh��	� 0������I��=� �E��}��C�� 8� 8� :� B� B�I�N�QR�R�TV�W����
����#%��r�stringc�:�|jj|�y)z1Writes a unicode string into the internal buffer.N)rSr2)rTrVs  r�writezHelpFormatter.write�s�������6�"rc�B�|xj|jz
c_y)zIncreases the indentation.N�rRrH�rTs rr5zHelpFormatter.indent�������t�4�4�4�rc�B�|xj|jzc_y)zDecreases the indentation.NrZr[s r�dedentzHelpFormatter.dedent�r\r�prog�args�prefixc���|�td��d�}|d|j�d��|�d�}|j|jz
}|t|�dzk\r-dt|�z}|j	t||||���ne|j	|�|j	d�dt
|jt|��d	zz}|j	t||||���|j	d�y)
z�Writes a usage line into the buffer.

        :param prog: the program name.
        :param args: whitespace separated list of arguments.
        :param prefix: The prefix for the first line. Defaults to
            ``"Usage: "``.
        NzUsage:r0�>r"�)r'r(r/�)�_rRr&rrXrEr)rTr_r`ra�usage_prefix�
text_widthr5s       r�write_usagezHelpFormatter.write_usage�s����>��(��}�A�&�F� ��4�#6�#6�"7�p� 7�8���a�@���Z�Z�$�"5�"5�5�
��(�<�0�2�5�6��8�L�1�1�F��J�J����#/�&,�	�
�
�J�J�|�$��J�J�t���C�� 3� 3�X�f�5E�F��J�K�F��J�J���*�V�v��
�	
�
�
�4�r�headingc�N�|jdd|j�d��|�d��y)z!Writes a heading into the buffer.r"rcz:
N)rXrR)rTrjs  r�
write_headingzHelpFormatter.write_heading�s,���
�
�b��4�.�.�/�p�/�0��	��=�>rc�@�|jr|jd�yy)z#Writes a paragraph into the buffer.r/N)rSrXr[s r�write_paragraphzHelpFormatter.write_paragraph�s���;�;��J�J�t��rr%c	��d|jz}|jt||j||d���|jd�y)zaWrites re-indented text into the buffer.  This rewraps and
        preserves paragraphs.
        r0T)r'r(r)r/N)rRrXrEr&)rTr%r5s   r�
write_textzHelpFormatter.write_text�sI���t�*�*�*���
�
����
�
�%�"(�$(�
�	
�	
�
�
�4�rr	�col_max�col_spacingc�,�t|�}t|�}t|�dk7rtd��t	|d|�|z}t|t|��D�]:\}}|j
dd|j�d��|���|s|j
d��?t|�||z
kr!|j
d|t|�z
z�n2|j
d�|j
d||jzz�t|j|z
dz
d�}t||d	�
�}	|	j�}
|
rK|j
|
d�d��|
ddD]*}|j
dd||jz�d��|�d���,��*|j
d���=y)
anWrites a definition list into the buffer.  This is how options
        and commands are usually formatted.

        :param rows: a list of two item tuples for the terms and values.
        :param col_max: the maximum width of the first column.
        :param col_spacing: the number of spaces between the first and
                            second column.
        rLz(Expected two columns for definition listrr"rcr/r0�
T)r)rN)
�listrr#�	TypeErrorrOr$rXrRrrr&rEr<)rTr	rqrrr�	first_col�first�secondrh�wrapped_text�linesrAs            r�write_dlzHelpFormatter.write_dl�s����D�z���t�$���v�;�!���F�G�G���q�	�7�+�k�9�	�&�t�S��[�9�	!�M�E�6��J�J�"�Q�t�2�2�3�0�3�4�U�G�<�=���
�
�4� �����)�k�"9�9��
�
�3�)�h�u�o�"=�>�?��
�
�4� ��
�
�3�)�d�.A�.A�"A�B�C��T�Z�Z�)�3�a�7��<�J�$�V�Z�T�R�L� �+�+�-�E���
�
�e�A�h�Z�r�?�+�!�!�"�I�S�D��J�J�"�Q�y�4�3F�3F�'F�&G�p�$G�!H���b�Q�R�S��
�
�4� �+	!r�namec#��K�|j�|j|�|j�	d��|j�y#|j�wxYw�w)z�Helpful context manager that writes a paragraph, a heading,
        and the indents.

        :param name: the section name that is written as heading.
        N)rnrlr5r^)rTr}s  r�sectionzHelpFormatter.section�sE����	
�������4� ����
�	���K�K�M��D�K�K�M�s�2A�A
�A�
A�Ac#�K�|j�	d��|j�y#|j�wxYw�w)z1A context manager that increases the indentation.N)r5r^r[s r�indentationzHelpFormatter.indentation
s+����	
���
�	���K�K�M��D�K�K�M�s�>�)�>�;�>c�8�dj|j�S)zReturns the buffer contents.r")r3rSr[s r�getvaluezHelpFormatter.getvalues���w�w�t�{�{�#�#r)rLNNr8)r"N)�rL)�__name__�
__module__�__qualname__�__doc__�int�t�OptionalrU�strrXr5r^rirlrnrp�Sequence�Tupler|r�Iteratorrr�r�r
rrrGrGfso��	�!"�!%�%)�	&��&��z�z�#��&��:�:�c�?�	&�

�&�&#�C�#�D�#�5�5�
DH�&��&�"�&�12���C��&�	
�&�P?�S�?�T�?��
�s��t��&��	*!��j�j�����c��*�+�*!��*!��	*!�

�*!�X��C��A�J�J�t�$4������Q�Z�Z��-����$�#�$rrG�optionsc���g}d}|D]3}t|�d}|dk(rd}|jt|�|f��5|jd���dj	d�|D��|fS)	aGiven a list of option strings this joins them in the most appropriate
    way and returns them in the form ``(formatted_string,
    any_prefix_is_slash)`` where the second item in the tuple is a flag that
    indicates if any of the option prefixes was a slash.
    Fr�/Tc��|dS)Nrr
)rs r�<lambda>zjoin_options.<locals>.<lambda>,s
��!�A�$�r)�keyz, c3�&K�|]	}|d���y�w)rNr
)rrs  rrzjoin_options.<locals>.<genexpr>-s����&�a�Q�q�T�&�r)rr2r#�sortr3)r�rC�any_prefix_is_slash�optras     r�join_optionsr�sy��
�B����&���3���"���S�=�"&��
�	�	�3�v�;��$�%�
&��G�G��G���9�9�&�2�&�&�(;�;�;r)�Nr"r"F)�typingr��
contextlibrrrf�_compatr�parserrrr�r��__annotations__�Iterabler�r�rr�r$�boolrErGr�r�r
rr�<module>r�s/���%� ���!%��a�j�j��o�$�7��
�
�1�7�7�3��8�#4�5�7�!�'�'�#�s�(�:K�7�3�
�*�*�Q�W�W�S�#�X�&�
'�3�47�3��Z�Z�����S��!�"�3���� %�F�

�F��F��F��	F�
�F�	�
F�Rr$�r$�j<�!�*�*�S�/�<�a�g�g�c�4�i�.@�<r

Zerion Mini Shell 1.0