Hacked By AnonymousFox

Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/textwrap.cpython-33.pyc

�
��fh@c@s�dZddlZdddddgZdZGd	d�d�Zd
dd�Zd
dd�Zejd
ej�Z	ejdej�Z
dd�Zedd�Z
edkr�eed��ndS(uText wrapping and filling.
iNuTextWrapperuwrapufilludedentuindentu	

 cBs�|EeZdZdZiZed�ZxeD]Zeeee�<q/We	j
d�Ze	j
d�Ze	j
d�Z
ddddddddddd	d
�
Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS(uTextWrapperu}
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
    u uL(\s+|[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))u(\s+)u[a-z][\.\!\?][\"\']?\ZiFuicCs^||_||_||_||_||_||_||_||_|	|_|
|_	dS(N(
uwidthuinitial_indentusubsequent_indentuexpand_tabsureplace_whitespaceufix_sentence_endingsubreak_long_wordsudrop_whitespaceubreak_on_hyphensutabsize(uselfuwidthuinitial_indentusubsequent_indentuexpand_tabsureplace_whitespaceufix_sentence_endingsubreak_long_wordsudrop_whitespaceubreak_on_hyphensutabsize((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu__init__as									uTextWrapper.__init__cCs@|jr|j|j�}n|jr<|j|j�}n|S(u�_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo	bar

baz"
        becomes " foo    bar  baz".
        (uexpand_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
<listcomp>�s	u&TextWrapper._split.<locals>.<listcomp>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<n|sz|j|j��ndS(u
_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        iNi����i����i����(ubreak_long_wordsuappendupop(uselfureversed_chunksucur_lineucur_lenuwidthu
space_left((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu_handle_long_word�s
	
	uTextWrapper._handle_long_wordc	Cs�g}|jdkr+td|j��n|j�xH|rg}d}|r\|j}n	|j}|jt|�}|jr�|dj�dkr�|r�|d=nxK|r�t|d�}|||kr�|j|j	��||7}q�Pq�W|r*t|d�|kr*|j
||||�n|jrY|rY|d	j�dkrY|d
=n|r8|j|dj|��q8q8W|S(u�_wrap_chunks(chunks : [string]) -> [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.pyuTextWrappers4+
	!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(uTextWrapperuwrap(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(uTextWrapperufill(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�xF|jd�D]2}|s�|j|�s�td||f��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
uline = %r, margin = %ru(?m)^N(	uNoneu_whitespace_only_reusubu_leading_whitespace_reufindallu
startswithusplituAssertionErrorure(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.<locals>.predicatec3s9x2�jd�D]!}�|�r,�|n|VqWdS(NT(u
splitlinesuTrue(uline(u	predicateuprefixutext(u-/opt/alt/python33/lib64/python3.3/textwrap.pyuprefixed_lines�suindent.<locals>.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_whitespaceuTextWrapperuwrapufillucompileu	MULTILINEu_whitespace_only_reu_leading_whitespace_reudedentuNoneuindentu__name__uprint(((u-/opt/alt/python33/lib64/python3.3/textwrap.pyu<module>s
�!
1

Hacked By AnonymousFox1.0, Coded By AnonymousFox