%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/text.cpython-312.pyc

�

Ϫ�f#��B�dZd
d�Zd�Zd�Zdd�ZeZd�Zd�Zd�Zdd�Z	y	)
z'
Miscellany of text-munging functions.
c�f�d}g}t|�tur�d}|j�D]{\}}t||dz�}t	|�r4t|�r|dt
d�}|j|�d|�d|����T|j|�d|�d|t
|�d	zd����}n�t|�tust|�turOt|�turd
}nd}|D]3}t||dz�}|j|j�dz��5n*t|fd
�t|�jd��|dd|s|j|�|r.||dz|dt
|�dzdz|d<|d|dz|d<dj|�}t	|�rt|�s|dz}|S)al
    Expansive string formatting for sequence types.

    C{list.__str__} and C{dict.__str__} use C{repr()} to display their
    elements.  This function also turns these sequence types
    into strings, but uses C{str()} on their elements instead.

    Sequence elements are also displayed on separate lines, and nested
    sequences have nested indentation.
    �z{}z   N�
� z:
z: �z()z[]�,c��||zS�N�)�s�is  �5/usr/lib/python3/dist-packages/twisted/python/text.py�<lambda>zstringyString.<locals>.<lambda>/s
��Q��U�������)�type�dict�items�
stringyString�isMultiline�
endsInNewline�len�append�tuple�list�rstrip�map�str�split�join)�object�indentation�braces�sl�key�value�elementrs        r
rrs����F�	�B��F�|�t���� �,�,�.�	S�J�C��!�%��u�)<�=�E��5�!� ��'�!�,�S��Y�J�/�E��	�	�[�M��3�%�s�5�'�:�;��	�	�[�M��3�%�r�%��K�8H�1�8L�8N�2O�1P�Q�R�	S�
�f���	�$�v�,�$�"6���<�5� ��F��F��	.�G�#�G�[�3�->�?�G��I�I�g�n�n�&��,�-�	.���2�C��K�4E�4E�d�4K�L��1��
�
�	�	�+��
��f�Q�i�'�"�Q�%��K�0@�1�0D�0F�*G�G��1���B��&��*�$��2���	�	�"�
�A��1�~�m�A�.�
��H���Hrc�*�|jd�dk7S)z=
    Returns C{True} if this string has a newline in it.
    rr)�find�rs r
rr@s��
�6�6�$�<�2��rc�&�|td�ddk(S)z;
    Returns C{True} if this string ends in a newline.
    rN)rr+s r
rrGs��
�c�$�i�Z�\�?�d�"�"rc���g}|jd�dk\r9|jd�}|D]!}|jt||�dgz��#|S|j�}d}d}|r�|t	||�z}|dz}||kDr:|dk(rn|dz
}|d|||d}}|jdj
|��d}d}n9t	|�|kDs&|jdj
|��|dd�=n|dz}|r��|S)a
    Given a string and a column width, return a list of lines.

    Caveat: I'm use a stupid greedy word-wrapping
    algorythm.  I won't put two spaces at the end
    of a sentence.  I don't do full justification.
    And no, I've never even *heard* of hypenation.
    z

rrrNr)r*r �extend�
greedyWraprrr!)	�inString�width�outLines�
paragraphs�para�inWords�column�ptr_line�ls	         r
r/r/Ns���H��}�}�V���!��^�^�F�+�
��	<�D��O�O�J�t�U�3�r�d�:�;�	<����n�n��G�
�F��H�
��#�g�h�/�0�0���a�<���E�>��1�}��$�a�<��#�A�h�/����1C��Q��O�O�C�H�H�Q�K�(��H��F��g�,��)��O�O�C�H�H�W�-�.���
��a�Z�F�-�2�Orc�`�g}|D]&}|s|j�s�|j|��(|Sr	)�stripr)�lines�ret�lines   r
�removeLeadingBlanksr>�s4��
�C�����$�*�*�,��J�J�t����Jrc��t|jd��}|j�t|�}|j�dj|�dzS)Nr)r>r �reverser!)rr;s  r
�removeLeadingTrailingBlanksrA�sD�������
�.�E�	�M�M�O���&�E�	�M�M�O��9�9�U��d�"�"rc�:�g}d}d}|j�D]�}|�|r|ddvr|d}|dd}g}|�|j|��.|rA|d|k(r9|dd}|j|�|jdj|��d}�q|j|���|S)a=
    Like a string split, but don't break substrings inside quotes.

    >>> splitQuoted('the "hairy monkey" likes pie')
    ['the', 'hairy monkey', 'likes', 'pie']

    Another one of those "someone must have a better solution for
    this" things.  This implementation is a VERY DUMB hack done too
    quickly.
    Nr)�"�'rrr)r rr!)r�out�quot�phrase�words     r
�splitQuotedrI�s���
�C��D�
�F����	�$���>���a��J�.��A�w���A�B�x�����>��J�J�t����b��T�)��C�R�y���
�
�d�#��
�
�3�8�8�F�+�,����
�
�d�#�!$�$�Jrc�f�t|��}tt|�d�}|s|j�}	|j	|t|�z
�}|s|j�}t|�}|dk(ryt|�|z|z
}|dkr||z}n||d|z}|j|�dk7ry�z)z[
    Find whether string C{p} occurs in a read()able object C{f}.

    @rtype: C{bool}
    irFNrT)r�maxr�lower�readr*)�p�f�
caseSensitive�buf�buf_len�r�
bytes_readr8s        r
�strFilerU�s����$�q�'�)�C��#�a�&�*�%�G��
�G�G�I��
�
�F�F�7�S��V�#�$������	�A���V�
���?����H�z�!�G�+����6���'�C��a�b�'�A�+�C��8�8�A�;�"���rN)r)�P)T)
�__doc__rrrr/�wordWrapr>rArIrUr
rr
�<module>rYs<���
2
�j�#�/�d���#� �Fr

Zerion Mini Shell 1.0