Your IP : 13.59.217.1


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/textwrap.cpython-310.opt-2.pyc

o

6��f<M�@s�	ddlZgd�ZdZGdd�d�Zddd�Zdd	d
�Zdd�Ze�d
ej�Z	e�dej�Z
dd�Zddd�Ze
dkrCeed��dSdS)�N)�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c@s�eZdZ	iZed�ZeD]Zeeee�<q
dZdZ	de
�e�Zdedd�Z
e
�dee	ee
d	�e
j�Z[[	[
e
�d
e�Z[e
�d�Z		
	
							d%ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&r� z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r�//opt/alt/python310/lib64/python3.10/textwrap.py�__init__ss
zTextWrapper.__init__cCs*	|jr
|�|j�}|jr|�|j�}|Sr)r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�szTextWrapper._munge_whitespacecCs8	|jdur
|j�|�}n|j�|�}dd�|D�}|S)NTcSsg|]}|r|�qSrr��.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s
zTextWrapper._splitcCsp	d}|jj}|t|�dkr6||ddkr(|||�r(d||d<|d7}n|d7}|t|�dksdSdS)Nrr	rz  �)�sentence_end_re�search�len)rr-�iZ	patsearchrrr�_fix_sentence_endings�s
�z!TextWrapper._fix_sentence_endingsc	Cs�	|dkrd}n||}|jrM|}|d}|jr:t|�|kr:|�dd|�}|dkr:tdd�|d|�D��r:|d}|�|d|��||d�|d<dS|sX|�|���dSdS)Nr	����-rcss�|]}|dkVqdS)r6Nrr%rrr�	<genexpr>�s�z0TextWrapper._handle_long_word.<locals>.<genexpr>)rrr2�rfind�any�append�pop)	rZreversed_chunks�cur_line�cur_lenrZ
space_left�end�chunkZhyphenrrr�_handle_long_word�s 	"�zTextWrapper._handle_long_wordc	Cs�	g}|jdkrtd|j��|jdur2|jdkr|j}n|j}t|�t|j���|jkr2td��|��|�r@g}d}|rC|j}n|j}|jt|�}|j	r]|d�
�dkr]|r]|d=|rzt|d�}|||krw|�|���||7}nn|s_|r�t|d�|kr�|�
||||�ttt|��}|j	r�|r�|d�
�dkr�|t|d�8}|d=|�r>|jdus�t|�d|jks�|r�|j	r�t|�dkr�|d�
�s�||kr�|�|d�|��nb|�r|d�
��r|t|j�|k�r|�|j�|�|d�|��		|S|t|d�8}|d=|s�|�r1|d��}t|�t|j�|jk�r1||j|d<	|S|�||j���	|S|s9|S)Nrzinvalid width %r (must be > 0)r	z#placeholder too large for max widthr5r)r�
ValueErrorrrrr2r�lstrip�reverser�stripr:r;r@�sum�map�join�rstrip)	rr-�linesrr<r=r�lZ	prev_linerrr�_wrap_chunks�s�



�
��
���	���IzTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r.r"rrr�
_split_chunksXs

zTextWrapper._split_chunkscCs&	|�|�}|jr|�|�|�|�Sr)rLrr4rKr,rrrr^s



zTextWrapper.wrapcCs	d�|�|��S)N�
)rGrr"rrrrlszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr)r+r0rr$r.r4r@rKrLrrrrrrrsV0���
��)grrcK�	tdd|i|��}|�|�S�Nrr)rr�r#r�kwargs�wrrrrxs	
rcKrXrY)rrrZrrrr�s
rcKs.	td|dd�|��}|�d�|������S)Nr	)rrrr)rrrGrDr*rZrrrr�srz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�	d}t�d|�}t�|�}|D]1}|dur|}q|�|�rq|�|�r'|}qtt||��D]\}\}}||kr@|d|�}nq.q	|rNt�d|d|�}|S)NrrrMz(?m)^)	�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr*rT)r#Zmargin�indentsrr3rS�y�linerrrr�s*


��rcs.	�dur	dd�����fdd�}d�|��S)NcSs|��Sr)rD�rfrrr�	predicate�szindent.<locals>.predicatec3s,���d�D]
}�|�r�|n|VqdS)NT)�
splitlinesrg�rh�prefixr#rr�prefixed_lines�s��zindent.<locals>.prefixed_linesr)rG)r#rkrhrlrrjrr�s
r�__main__z Hello there.
  This is indented.)rr)rT�__all__rRrrrrrV�	MULTILINEr]r_rrrN�printrrrr�<module>s"
i


3�

?>