Package horizons :: Package ext :: Module polib :: Class TextWrapper
[hide private]
[frames] | no frames]

Class TextWrapper

source code

textwrap.TextWrapper --+
                       |
                      TextWrapper

Subclass of textwrap.TextWrapper that backport the drop_whitespace option.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
_wrap_chunks(self, chunks)
_wrap_chunks(chunks : [string]) -> [string]
source code

Inherited from textwrap.TextWrapper: fill, wrap

Inherited from textwrap.TextWrapper (private): _fix_sentence_endings, _handle_long_word, _munge_whitespace, _split

Class Variables [hide private]

Inherited from textwrap.TextWrapper: sentence_end_re, unicode_whitespace_trans, uspace, whitespace_trans, wordsep_re, wordsep_simple_re, x

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Overrides: textwrap.TextWrapper.__init__

_wrap_chunks(self, chunks)

source code 

_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.

Overrides: textwrap.TextWrapper._wrap_chunks