ž Ś˙fh@c@sĆdZddlZdddddgZdZGd d„dƒZd d d„Zd d d„Zejd ejƒZ ejdejƒZ dd„Z e dd„Z edkrÂee dƒƒndS(uText wrapping and filling. iNu TextWrapperuwrapufilludedentuindentu c Bsř|EeZdZdZiZedƒZxeD]Zeeeeƒ string Munge whitespace in text: expand tabs and convert all other whitespace characters to spaces. Eg. " foo bar baz" becomes " foo bar baz". (u expand_tabsu expandtabsutabsizeureplace_whitespaceu translateuunicode_whitespace_trans(uselfutext((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu_munge_whitespace{s   uTextWrapper._munge_whitespacecCsM|jdkr$|jj|ƒ}n|jj|ƒ}dd„|Dƒ}|S(uN_split(text : string) -> [string] Split the text to wrap into indivisible chunks. Chunks are not quite the same as words; see _wrap_chunks() for full details. As an example, the text Look, goof-ball -- use the -b option! breaks into the following chunks: 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', 'use', ' ', 'the', ' ', '-b', ' ', 'option!' if break_on_hyphens is True, or in: 'Look,', ' ', 'goof-ball', ' ', '--', ' ', 'use', ' ', 'the', ' ', '-b', ' ', option!' otherwise. cSsg|]}|r|‘qS(((u.0uc((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu œs u&TextWrapper._split..T(ubreak_on_hyphensuTrueu wordsep_reusplituwordsep_simple_re(uselfutextuchunks((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu_split‰s uTextWrapper._splitcCs|d}|jj}xc|t|ƒdkrw||ddkrj|||ƒrjd||d<|d7}q|d7}qWdS(uf_fix_sentence_endings(chunks : [string]) Correct for sentence endings buried in 'chunks'. Eg. when the original text contains "... foo. Bar ...", munge_whitespace() and split() will convert that to [..., "foo.", " ", "Bar", ...] which has one too few spaces; this method simply changes the one space to two. iiu u iN(usentence_end_reusearchulen(uselfuchunksuiu patsearch((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu_fix_sentence_endingsŸs  $ u!TextWrapper._fix_sentence_endingscCs~|dkrd}n ||}|jr^|j|dd|…ƒ|d|d…|d [string] Wrap a sequence of text chunks and return a list of lines of length 'self.width' or less. (If 'break_long_words' is false, some lines may be longer than this.) Chunks correspond roughly to words and the whitespace between them: each chunk is indivisible (modulo 'break_long_words'), but a line break can come between any two chunks. Chunks should not have internal whitespace; ie. a chunk is either all whitespace or a "word". Whitespace chunks will be removed from the beginning and end of lines, but apart from that whitespace is preserved. iuinvalid width %r (must be > 0)iui˙˙˙˙i˙˙˙˙i˙˙˙˙i˙˙˙˙i˙˙˙˙i˙˙˙˙( uwidthu ValueErrorureverseusubsequent_indentuinitial_indentulenudrop_whitespaceustripuappendupopu_handle_long_wordujoin(uselfuchunksulinesucur_lineucur_lenuindentuwidthul((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu _wrap_chunksŇs4     %   % !uTextWrapper._wrap_chunkscCsD|j|ƒ}|j|ƒ}|jr7|j|ƒn|j|ƒS(u^wrap(text : string) -> [string] Reformat the single paragraph in 'text' so it fits in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space. (u_munge_whitespaceu_splitufix_sentence_endingsu_fix_sentence_endingsu _wrap_chunks(uselfutextuchunks((u-/opt/alt/python33/lib64/python3.3/textwrap.pyuwraps  uTextWrapper.wrapcCsdj|j|ƒƒS(uŢfill(text : string) -> string Reformat the single paragraph in 'text' to fit in lines of no more than 'self.width' columns, and return a new string containing the entire wrapped paragraph. u (ujoinuwrap(uselfutext((u-/opt/alt/python33/lib64/python3.3/textwrap.pyufill*suTextWrapper.fillNTF(u__name__u __module__u __qualname__u__doc__uunicode_whitespace_transuorduuspaceu _whitespaceuxureucompileu wordsep_reuwordsep_simple_reusentence_end_reuTrueuFalseu__init__u_munge_whitespaceu_splitu_fix_sentence_endingsu_handle_long_wordu _wrap_chunksuwrapufill(u __locals__((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu TextWrappers4+       ! I iFcKstd||}|j|ƒS(uČWrap a single paragraph of text, returning a list of wrapped lines. Reformat the single paragraph in 'text' so it fits in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. uwidth(u TextWrapperuwrap(utextuwidthukwargsuw((u-/opt/alt/python33/lib64/python3.3/textwrap.pyuwrap6s cKstd||}|j|ƒS(u–Fill a single paragraph of text, returning a new string. Reformat the single paragraph in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped paragraph. As with wrap(), tabs are expanded and other whitespace characters converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. uwidth(u TextWrapperufill(utextuwidthukwargsuw((u-/opt/alt/python33/lib64/python3.3/textwrap.pyufillCs u^[ ]+$u(^[ ]*)(?:[^ ])cCsÍd}tjd|ƒ}tj|ƒ}xT|D]L}|dkrI|}q.|j|ƒr[q.|j|ƒrs|}q.d}Pq.Wdr§|r§x|jdƒD]}qšWn|rÉtjd|d|ƒ}n|S(u9Remove any common leading whitespace from every line in `text`. This can be used to make triple-quoted strings line up with the left edge of the display, while still presenting them in the source code in indented form. Note that tabs and spaces are both treated as whitespace, but they are not equal: the lines " hello" and " hello" are considered to have no common leading whitespace. (This behaviour is new in Python 2.5; older versions of this module incorrectly expanded tabs before searching for common leading whitespace.) uiu u(?m)^N(uNoneu_whitespace_only_reusubu_leading_whitespace_reufindallu startswithuspliture(utextumarginuindentsuindentuline((u-/opt/alt/python33/lib64/python3.3/textwrap.pyudedentUs$     csCˆdkrdd„‰n‡‡‡fdd†}dj|ƒƒS(uFAdds 'prefix' to the beginning of selected lines in 'text'. If 'predicate' is provided, 'prefix' will only be added to the lines where 'predicate(line)' is True. If 'predicate' is not provided, it will default to adding 'prefix' to all non-empty lines that do not consist solely of whitespace characters. cSs |jƒS(N(ustrip(uline((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu predicatesuindent..predicatec3s9x2ˆjdƒD]!}ˆ|ƒr,ˆ|n|VqWdS(NT(u splitlinesuTrue(uline(u predicateuprefixutext(u-/opt/alt/python33/lib64/python3.3/textwrap.pyuprefixed_lines’suindent..prefixed_linesuN(uNoneujoin(utextuprefixu predicateuprefixed_lines((u predicateuprefixutextu-/opt/alt/python33/lib64/python3.3/textwrap.pyuindent†s u__main__u Hello there. This is indented.(u__doc__ureu__all__u _whitespaceu TextWrapperuwrapufillucompileu MULTILINEu_whitespace_only_reu_leading_whitespace_reudedentuNoneuindentu__name__uprint(((u-/opt/alt/python33/lib64/python3.3/textwrap.pyus  ˙!  1