Edit File: textwrap.cpython-36.opt-2.pyc
3 � \fL������������������@���s����d�dl�Z�ddddddgZdZG�d d��d�Zddd�Zddd�Zd d��Ze�jde�j�Z e�jde�j�Z dd��Zddd�Ze dkr�eed���dS�)�����N�TextWrapper�wrap�fill�dedent�indent�shortenz c������������ ���@���s����e�Zd�Zi�Zed�ZxeD�]Zeeee�<�qW�dZdZ de je��Zdedd���Z e jdee ee d ��e j�Z[[ [ e jd e��Z[e jd�Zd%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������ ������C���sL���||�_�||�_||�_||�_||�_||�_||�_||�_| |�_| |�_ ||�_ ||�_d�S�)N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizer���r���) �selfr���r���r���r���r���r���r���r���r���r���r���r�����r���� /usr/lib64/python3.6/textwrap.py�__init__s���s����zTextWrapper.__init__c�������������C���s(���|�j�r|j|�j�}|�jr$|j|�j�}|S�)N)r���� expandtabsr���r���� translate�unicode_whitespace_trans)r����textr���r���r����_munge_whitespace����s ����zTextWrapper._munge_whitespacec�������������C���s6���|�j�dkr|�jj|�}n|�jj|�}dd��|D��}|S�)NTc�������������S���s���g�|�]}|r|�qS�r���r���)�.0�cr���r���r���� <listcomp>����s����z&TextWrapper._split.<locals>.<listcomp>)r���� wordsep_re�split�wordsep_simple_re)r���r!����chunksr���r���r����_split����s ���� zTextWrapper._splitc�������������C���s`���d}|�j�j}xN|t|�d�k�rZ||d��dkrP|||��rPd||d�<�|d7�}q|d7�}qW�d�S�)Nr���r ���r���z ����)�sentence_end_re�search�len)r���r)����iZ patsearchr���r���r����_fix_sentence_endings����s���� z!TextWrapper._fix_sentence_endingsc�������������C���s^���|dk�rd}n||�}|�j�rH|j|d�d�|����|d�|d���|d<�n|sZ|j|j����d�S�)Nr ������r1���r1���)r����append�pop)r���Zreversed_chunks�cur_line�cur_lenr���Z space_leftr���r���r����_handle_long_word����s���� zTextWrapper._handle_long_wordc������� ������C���s���g�}|�j�dkrtd|�j����|�jd�k rb|�jdkr8|�j}n|�j}t|�t|�jj����|�j�krbtd��|j����x&|�r�g�}d}|r�|�j}n|�j}|�j�t|��}|�j r�|d�j ��dkr�|r�|d=�x:|r�t|d��}||�|kr�|j|j����||7�}q�P�q�W�|�r.t|d ��|k�r.|�j ||||��ttt|��}|�j �rd|�rd|d �j ��dk�rd|t|d��8�}|d=�|rn|�jd�k�s�t|�d�|�jk��s�|��s�|�j �r�t|�dk�r�|d�j ����r�||k�r�|j|dj|����qnx�|�r<|d �j ���r"|t|�j��|k�r"|j|�j��|j|dj|����P�|t|d��8�}|d=��q�W�|�rz|d�j��}t|�t|�j��|�j�k�rz||�j�|d<�P�|j||�jj�����P�qnW�|S�)Nr���zinvalid width %r (must be > 0)r ���z#placeholder too large for max widthr���r1���r1���r1���r1���r1���r1���r1���r1���r1���r1���r1���r1���)r���� ValueErrorr���r���r���r.���r����lstrip�reverser����stripr2���r3���r6����sum�map�join�rstrip) r���r)����linesr���r4���r5���r����lZ prev_liner���r���r����_wrap_chunks����sp���� zTextWrapper._wrap_chunksc�������������C���s���|�j�|�}|�j|�S�)N)r"���r*���)r���r!���r���r���r���� _split_chunksP��s���� zTextWrapper._split_chunksc�������������C���s$���|�j�|�}|�jr|�j|��|�j|�S�)N)rB���r���r0���rA���)r���r!���r)���r���r���r���r���V��s���� zTextWrapper.wrapc�������������C���s���dj�|�j|��S�)N� )r=���r���)r���r!���r���r���r���r���d��s����zTextWrapper.fill) r���r���r���TTFTTTr ���)�__name__� __module__�__qualname__r ����ordZuspace�_whitespace�xZ word_punctZletter�re�escapeZ whitespaceZnowhitespace�compile�VERBOSEr&���r(���r,���r���r"���r*���r0���r6���rA���rB���r���r���r���r���r���r���r������sH���1 ���������!gr���c�������������K���s���t�f�d|i|��}|j|��S�)Nr���)r���r���)r!���r����kwargs�wr���r���r���r���p��s���� c�������������K���s���t�f�d|i|��}|j|��S�)Nr���)r���r���)r!���r���rN���rO���r���r���r���r���}��s���� c�������������K���s,���t�f�|dd�|��}|jdj|�j��j����S�)Nr ���)r���r���r���)r���r���r=���r:���r'���)r!���r���rN���rO���r���r���r���r������s����z^[ ]+$z(^[ ]*)(?:[^ ])c�������������C���s����d�}t�jd|��}�tj|��}x||D�]t}|d�kr2|}q |j|�r>q |j|�rN|}q xDtt||��D�]"\}\}}||kr^|d�|��}P�q^W�|d�t|���}q W�dr�|r�x|�jd�D�]}q�W�|r�t jd|�d|��}�|�S�)Nr���r���rC���z(?m)^) �_whitespace_only_re�sub�_leading_whitespace_re�findall� startswith� enumerate�zipr.���r'���rJ���)r!���Zmargin�indentsr���r/���rI����y�liner���r���r���r������s*���� c����������������s,�����d�krdd��������fdd�}dj�|���S�)Nc�������������S���s���|�j���S�)N)r:���)rY���r���r���r���� predicate���s����zindent.<locals>.predicatec��������������3���s.���x(�j�d�D�]}���|��r �|��n|�V��qW�d�S�)NT)� splitlines)rY���)rZ����prefixr!���r���r����prefixed_lines���s����zindent.<locals>.prefixed_linesr���)r=���)r!���r\���rZ���r]���r���)rZ���r\���r!���r���r������s�����__main__z Hello there. This is indented.)r���)r���)N)rJ����__all__rH���r���r���r���r���rL���� MULTILINErP���rR���r���r���rD����printr���r���r���r����<module>���s�����a 5