grepros 1.2.2
grep for ROS bag files and live topics
|
Prints messages to console. More...
Public Member Functions | |
__init__ (self, args=None, **kwargs) | |
emit (self, topic, msg, stamp=None, match=None, index=None) | |
Prints separator line and message text. | |
emit_meta (self) | |
Prints source metainfo like bag header, if not already printed. | |
is_highlighting (self) | |
Returns True if sink is configured to highlight matched values. | |
validate (self) | |
Returns whether arguments environment set, populates options, emits error if not. | |
Public Member Functions inherited from Sink | |
__init__ (self, args=None, **kwargs) | |
__enter__ (self) | |
Context manager entry. | |
__exit__ (self, exc_type, exc_value, traceback) | |
Context manager exit, closes sink. | |
autodetect (cls, target) | |
Returns true if target is recognizable as output for this sink class. | |
bind (self, source) | |
Attaches source to sink. | |
close (self) | |
Shuts down output, closing any files or connections. | |
configure (self, args=None, **kwargs) | |
Updates sink configuration. | |
emit (self, topic, msg, stamp=None, match=None, index=None) | |
Outputs ROS message. | |
emit_meta (self) | |
Outputs source metainfo like bag header as debug stream, if not already emitted. | |
flush (self) | |
Writes out any pending data to disk. | |
is_highlighting (self) | |
Returns whether this sink requires highlighted matches. | |
thread_excepthook (self, text, exc) | |
Handles exception, used by background threads. | |
validate (self) | |
Returns whether sink prerequisites are met (like ROS environment set if LiveSink). | |
Public Member Functions inherited from TextSinkMixin | |
__init__ (self, args=None, **kwargs) | |
format_message (self, msg, highlight=False) | |
Returns message as formatted string, optionally highlighted for matches if configured. | |
message_to_yaml (self, val, top=(), typename=None) | |
Returns ROS message or other value as YAML. | |
validate (self) | |
Returns whether arguments are valid, emits error if not, else populates options. | |
Public Attributes | |
valid | |
Public Attributes inherited from Sink | |
args | |
source | |
inputs.Source instance bound to this sink | |
valid | |
Result of validate() | |
Static Public Attributes | |
str | CONTEXT_PREFIX_SEP = "-" |
DEFAULT_ARGS | |
Constructor argument defaults. | |
str | MATCH_PREFIX_SEP = ":" |
str | MESSAGE_SEP_TEMPLATE = "{ll0}{sep}{ll1}" |
str | META_LINE_TEMPLATE = "{ll0}{sep} {line}{ll1}" |
str | PREFIX_TEMPLATE = "{pfx0}{batch}{pfx1}{sep0}{sep}{sep1}" |
str | SEP = "---" |
Static Public Attributes inherited from Sink | |
DEFAULT_ARGS = dict(META=False) | |
Constructor argument defaults. | |
tuple | FILE_EXTENSIONS = () |
Auto-detection file extensions for subclasses, as (".ext", ) | |
Static Public Attributes inherited from TextSinkMixin | |
DEFAULT_ARGS | |
Constructor argument defaults. | |
str | NOCOLOR_HIGHLIGHT_WRAPPERS = "**", "**" |
Default highlight wrappers if not color output. | |
Prints messages to console.
Definition at line 543 of file outputs.py.
__init__ | ( | self, | |
args = None , |
|||
** | kwargs | ||
) |
args | arguments as namespace or dictionary, case-insensitive |
args.color | False or "never" for not using colors in replacements |
args.highlight | highlight matched values (default true) |
args.meta | whether to print metainfo |
args.emit_field | message fields to emit if not all |
args.noemit_field | message fields to skip in output |
args.line_prefix | print source prefix like bag filename on each message line |
args.max_field_lines | maximum number of lines to print per field |
args.start_line | message line number to start output from |
args.end_line | message line number to stop output at |
args.max_message_lines | maximum number of lines to output per message |
args.lines_around_match | number of message lines around matched fields to output |
args.matched_fields_only | output only the fields where match was found |
args.wrap_width | character width to wrap message YAML output at |
args.match_wrapper | string to wrap around matched values, both sides if one value, start and end if more than one, or no wrapping if zero values |
kwargs | any and all arguments as keyword overrides, case-insensitive |
Reimplemented from Sink.
Definition at line 581 of file outputs.py.
emit | ( | self, | |
topic, | |||
msg, | |||
stamp = None , |
|||
match = None , |
|||
index = None |
|||
) |
Prints separator line and message text.
Reimplemented from Sink.
Definition at line 599 of file outputs.py.
emit_meta | ( | self | ) |
Prints source metainfo like bag header, if not already printed.
Reimplemented from Sink.
Definition at line 587 of file outputs.py.
is_highlighting | ( | self | ) |
Returns True if sink is configured to highlight matched values.
Reimplemented from Sink.
Definition at line 621 of file outputs.py.
validate | ( | self | ) |
Returns whether arguments environment set, populates options, emits error if not.
Reimplemented from Sink.
Definition at line 626 of file outputs.py.
|
static |
Definition at line 550 of file outputs.py.
|
static |
Constructor argument defaults.
Definition at line 554 of file outputs.py.
|
static |
Definition at line 549 of file outputs.py.
|
static |
Definition at line 547 of file outputs.py.
|
static |
Definition at line 546 of file outputs.py.
|
static |
Definition at line 548 of file outputs.py.
|
static |
Definition at line 551 of file outputs.py.
valid |
Definition at line 631 of file outputs.py.