Viewing File: /opt/alt/python35/lib64/python3.5/__pycache__/textwrap.cpython-35.opt-2.pyc



]fL@sddlZddddddgZdZGd	ddZd
ddZd
ddZd
dZejdejZ	ejdejZ
ddZdddZe
dkreeddS)NTextWrapperwrapfilldedentindentshortenz	

 c@skeZdZiZedZxeD]Zeeee<q%WdZdZ	de
jeZdeddZ
e
jdd	ed
e	dede
ie
jZ[[	[
e
jd
eZ[e
jdZdddddddddddddddd
ZddZddZddZdd Zd!d"Zd#d$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)
            )
        )ZwpltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\ZFTF	max_linesplaceholderz [...]c
Csp||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS)N)widthinitial_indentsubsequent_indentexpand_tabsreplace_whitespacefix_sentence_endingsbreak_long_wordsdrop_whitespacebreak_on_hyphenstabsizerr)
selfrrrrrrrrrrrrr-/opt/alt/python35/lib64/python3.5/textwrap.py__init__ss											zTextWrapper.__init__cCs:|jr|j|j}|jr6|j|j}|S)N)r
expandtabsrr	translateunicode_whitespace_trans)rtextrrr_munge_whitespaces
		zTextWrapper._munge_whitespacecCsM|jdkr$|jj|}n|jj|}dd|D}|S)NTcSsg|]}|r|qSrr).0crrr
<listcomp>s	z&TextWrapper._split.<locals>.<listcomp>)r
wordsep_resplitwordsep_simple_re)rr!chunksrrr_splits
zTextWrapper._splitcCs|d}|jj}xc|t|dkrw||ddkrj|||rjd||d<|d7}q|d7}qWdS)Nrr	rz  )sentence_end_researchlen)rr)i	patsearchrrr_fix_sentence_endingss	$
z!TextWrapper._fix_sentence_endingscCs{|dkrd}n
||}|jr^|j|dd||d|d|d<n|sw|j|jdS)Nr	r2r2)rappendpop)rreversed_chunkscur_linecur_lenr
space_leftrrr_handle_long_words
	
	zTextWrapper._handle_long_wordc	CsPg}|jdkr(td|j|jdk	r|jdkrR|j}n	|j}t|t|jj|jkrtd|jx|rKg}d}|r|j}n	|j}|jt|}|j	r|dj
dkr|r|d=xK|rUt|d}|||krQ|j|j||7}qPqW|rt|d	|kr|j
||||ttt|}|j	r|r|d
j
dkr|t|d8}|d=|r|jdksJt|d|jksJ|s>|j	rgt|dkrg|dj
rg||krg|j|dj|qx|r|d
j
r|t|j|kr|j|j|j|dj|P|t|d8}|d=qjW|r-|dj}t|t|j|jkr-||j|d<P|j||jjPqW|S)Nrzinvalid width %r (must be > 0)r	z#placeholder too large for max widthrr2r2r2r2r2r2r2r2r2r2r2r2)r
ValueErrorrrrr.rlstripreverserstripr3r4r9summapjoinrstrip)	rr)linesrr6r7rl	prev_linerrr_wrap_chunkssp
	(
		%	
%		zTextWrapper._wrap_chunkscCs|j|}|j|S)N)r"r*)rr!rrr
_split_chunksPszTextWrapper._split_chunkscCs2|j|}|jr%|j||j|S)N)rFrr1rE)rr!r)rrrrVs		
zTextWrapper.wrapcCsdj|j|S)N
)r@r)rr!rrrrdszTextWrapper.fill)__name__
__module____qualname__r orduspace_whitespacexZ
word_punctZletterreescape
whitespaceZnowhitespacecompileVERBOSEr&r(r,rr"r*r1r9rErFrrrrrrrsH1
	!grcKstd||}|j|S)Nr)rr)r!rkwargswrrrrps
cKstd||}|j|S)Nr)rr)r!rrTrUrrrr}s	cKs:td|dd|}|jdj|jjS)Nrrr	r)rrr@r=r')r!rrTrUrrrrsz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCsd}tjd|}tj|}x|D]}|dkrI|}q.|j|r[q.|j|rs|}q.x\tt||D]/\}\}}||kr|d|}PqW|dt|}q.Wdr|rx|jdD]}qW|rt	jd|d|}|S)NrrrGz(?m)^)
_whitespace_only_resub_leading_whitespace_refindall
startswith	enumeratezipr.r'rO)r!marginindentsrr/rNylinerrrrs*
		(cs@dkrddfdd}dj|S)NcSs
|jS)N)r=)r`rrr	predicateszindent.<locals>.predicatec3s9x2jdD]!}|r,|n|VqWdS)NT)
splitlines)r`)raprefixr!rrprefixed_linesszindent.<locals>.prefixed_linesr)r@)r!rcrardr)rarcr!rrs__main__z Hello there.
  This is indented.)rO__all__rMrrrrrR	MULTILINErVrXrrrHprintrrrr<module>s`
5
Back to Directory File Manager