AlkantarClanX12
Current Path : /opt/alt/python34/lib64/python3.4/__pycache__/ |
Current File : //opt/alt/python34/lib64/python3.4/__pycache__/textwrap.cpython-34.pyc |
� e fRK � @ s� d Z d d l Z d d d d d d g Z d Z Gd d � d � Z d d d � Z d d d � Z d d � Z e j d e j � Z e j d e j � Z d d � Z d d d � Z e d k r� e e d � � n d S)zText wrapping and filling. � N�TextWrapper�wrap�fill�dedent�indent�shortenz c @ s e Z d Z d Z i Z e d � Z x e D] Z e e e e � <q+ We j d � Z e j d � Z e j d � Z d d d d d d d d d d d d d d d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d S)!r a 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. max_lines (default: None) Truncate wrapped lines. placeholder (default: ' [...]') Append to the last line of truncated text. � zL(\s+|[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))z(\s+)z[a-z][\.\!\?][\"\']?\Z�F � TF� � max_linesN�placeholderz [...]c C sp | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ 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 �-/opt/alt/python34/lib64/python3.4/textwrap.py�__init__e s zTextWrapper.__init__c C s@ | j r | j | j � } n | j r<