grepros 1.2.2
grep for ROS bag files and live topics
|
TextWrapper that supports custom substring widths in line width calculation. More...
Public Member Functions | |
__init__ (self, width=80, subsequent_indent=" ", break_long_words=True, drop_whitespace=False, max_lines=None, placeholder=" ...", custom_widths=None) | |
reserve_width (self, reserved="") | |
Decreases the configured width by given amount (number or string). | |
strip (self, v) | |
Returns string with custom substrings and whitespace stripped. | |
strlen (self, v) | |
Returns length of string, using custom substring widths. | |
wrap (self, text) | |
Returns a list of wrapped text lines, without linebreaks. | |
Public Attributes | |
break_long_words | |
custom_lens | |
custom_rgx | |
customs | |
disabled | |
drop_whitespace | |
lencache | |
max_lines | |
minwidth | |
placeholder | |
realwidth | |
subsequent_indent | |
width | |
Static Public Attributes | |
int | LENCACHEMAX = 10000 |
Max length of strlen cache. | |
SPACE_RGX = re.compile(r"([%s]+)" % re.escape("\t\n\x0b\x0c\r ")) | |
Regex for breaking text at whitespace. | |
TextWrapper that supports custom substring widths in line width calculation.
Intended for wrapping text containing ANSI control codes. Heavily refactored from Python standard library textwrap.TextWrapper.
__init__ | ( | self, | |
width = 80 , |
|||
subsequent_indent = " " , |
|||
break_long_words = True , |
|||
drop_whitespace = False , |
|||
max_lines = None , |
|||
placeholder = " ..." , |
|||
custom_widths = None |
|||
) |
width | default maximum width to wrap at, 0 disables |
subsequent_indent | string prepended to all consecutive lines |
break_long_words | break words longer than width |
drop_whitespace | drop leading and trailing whitespace from lines |
max_lines | count to truncate lines from |
placeholder | appended to last retained line when truncating |
custom_widths | {substring: len} to use in line width calculation |
reserve_width | ( | self, | |
reserved = "" |
|||
) |
strip | ( | self, | |
v | |||
) |
strlen | ( | self, | |
v | |||
) |
wrap | ( | self, | |
text | |||
) |
|
static |
|
static |