³ò ”,9Mc @sØdZdZddkZddkZyeWn&ej odfd„ƒYZnXyeefWn%ej oddf\ZZnXdd d gZd Z dfd „ƒYZ d d„Z d d„Z d„Z dS(sText wrapping and filling. s;$Id: textwrap.py,v 1.32.8.2 2004/05/13 01:48:15 gward Exp $iÿÿÿÿNtunicodecBseZRS((t__name__t __module__(((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyRsiit TextWrappertwraptfills cBs4eZdZeiedeeƒƒZhZye dƒZ Wne j oe dƒZ nXx!e e eƒD]Ze ee string Munge whitespace in text: expand tabs and convert all other whitespace characters to spaces. Eg. " foo bar baz" becomes " foo bar baz". R( R tstringt expandtabsR ttypet translatetwhitespace_transt isinstanceRtunicode_whitespace_trans(Rttext((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyt_munge_whitespace„s  cCs%|ii|ƒ}td|ƒ}|S(s£_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!' N(t wordsep_retsplittfiltertNone(RRtchunks((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyt_split•s cCsd}|i}xk|t|ƒdjoS||ddjo0|i||ƒod||d<|d}q|d}qWdS(sf_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. iiRs iN(tsentence_end_retlentsearch(RRtitpat((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyt_fix_sentence_endings¤s  )cCspt||dƒ}|io.|i|dd|!ƒ|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. isinvalid width %r (must be > 0)Riÿÿÿÿ( Rt ValueErrorR R R!RtstripR'R(R,tjoin(RRtlinesR)R*tindentRtl((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyt _wrap_chunksÒs6   ! ! &cCsO|i|ƒ}|i}|i|ƒ}|io|i|ƒn|i|ƒS(s^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. (RR RR R%R3(RRR1R((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyRs   cCsti|i|ƒdƒS(sÞ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. s (RR/R(RR((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyR's(RRt__doc__Rt maketranst _whitespaceR!RRtevaltuspacet SyntaxErrortordtmaptxtretcompileRterrort lowercaseR tTruetFalseRRRR%R,R3RR(((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyR&s<"       E iFcKs5|iƒ}||d string Remove any whitespace than can be uniformly removed from the left of every line in `text`. This can be used e.g. to make triple-quoted strings line up with the left edge of screen/whatever, while still presenting it in the source code in indented form. For example: def test(): # end first line with \ to avoid the empty line! s = ''' hello world ''' print repr(s) # prints ' hello world ' print repr(dedent(s)) # prints 'hello world ' s iN( RRRtlstripR!tmintrangeRR/(RR0tmargintlinetcontentR1R#((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pytdedentSs    (R4t __revision__RR=Rt NameErrorRARBt__all__R6RRRRN(((sAinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_textwrap.pyss" ÿ