class documentation

Custom subclass that uses a different word separator regex.

Class Variable wordsep_re Undocumented
Method _break_word _break_word(word : string, space_left : int) -> (string, string)
Method _handle_long_word _handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int)
Method _split _split(text : string) -> [string]
Method _wrap_chunks _wrap_chunks(chunks : [string]) -> [string]
wordsep_re = (source)

Undocumented

def _break_word(self, word, space_left): (source)

_break_word(word : string, space_left : int) -> (string, string) Break line by unicode width instead of len(word).

Parameters
word:strUndocumented
space_left:intUndocumented
Returns
tuple[str, str]Undocumented
def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width): (source)

_handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int) Override original method for using self._break_word() instead of slice.

Parameters
reversed_chunks:list[str]Undocumented
cur_line:list[str]Undocumented
cur_len:intUndocumented
width:intUndocumented
def _split(self, text): (source)

_split(text : string) -> [string] Override original method that only split by 'wordsep_re'. This '_split' splits wide-characters into chunks by one character.

Parameters
text:strUndocumented
Returns
list[str]Undocumented
def _wrap_chunks(self, chunks): (source)

_wrap_chunks(chunks : [string]) -> [string] The original _wrap_chunks uses len() to calculate width. This method respects wide/fullwidth characters for width adjustment.

Parameters
chunks:list[str]Undocumented
Returns
list[str]Undocumented