grepros 1.2.2
grep for ROS bag files and live topics
|
Combines any number of sinks. More...
Public Member Functions | |
__init__ (self, args=None, sinks=(), **kwargs) | |
Accepts more arguments, given to the real sinks constructed. | |
bind (self, source) | |
Attaches source to all sinks, sets thread_excepthook on all sinks. | |
close (self) | |
Closes all sinks. | |
configure (self, args=None, **kwargs) | |
Updates sinks configuration. | |
emit (self, topic, msg, stamp=None, match=None, index=None) | |
Outputs ROS message to all sinks. | |
emit_meta (self) | |
Outputs source metainfo in one sink, if not already emitted. | |
flush (self) | |
Flushes all sinks. | |
is_highlighting (self) | |
Returns whether any sink requires highlighted matches. | |
validate (self) | |
Returns whether prerequisites are met for all sinks. | |
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 Attributes | |
sinks | |
List of all combined sinks. | |
valid | |
Public Attributes inherited from Sink | |
args | |
source | |
inputs.Source instance bound to this sink | |
valid | |
Result of validate() | |
Static Public Attributes | |
dict | FLAG_CLASSES = {"PUBLISH": LiveSink, "CONSOLE": ConsoleSink, "APP": AppSink} |
Autobinding between argument flags and sink classes. | |
dict | FORMAT_CLASSES = {"bag": BagSink} |
Autobinding between –write TARGET format=FORMAT and sink classes. | |
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", ) | |
Combines any number of sinks.
Definition at line 918 of file outputs.py.
__init__ | ( | self, | |
args = None , |
|||
sinks = () , |
|||
** | kwargs | ||
) |
Accepts more arguments, given to the real sinks constructed.
args | arguments as namespace or dictionary, case-insensitive |
args.console | print matches to console |
args.write | [[target, format=FORMAT, key=value, ], ] |
args.publish | publish matches to live topics |
args.app | provide messages to given callback function |
sinks | pre-created sinks, arguments will be ignored |
kwargs | any and all arguments as keyword overrides, case-insensitive |
Reimplemented from Sink.
Definition at line 938 of file outputs.py.
bind | ( | self, | |
source | |||
) |
Attaches source to all sinks, sets thread_excepthook on all sinks.
Reimplemented from Sink.
Definition at line 980 of file outputs.py.
close | ( | self | ) |
configure | ( | self, | |
args = None , |
|||
** | kwargs | ||
) |
Updates sinks configuration.
args | arguments as namespace or dictionary, case-insensitive |
kwargs | any and all arguments as keyword overrides, case-insensitive |
Reimplemented from Sink.
Definition at line 993 of file outputs.py.
emit | ( | self, | |
topic, | |||
msg, | |||
stamp = None , |
|||
match = None , |
|||
index = None |
|||
) |
Outputs ROS message to all sinks.
Reimplemented from Sink.
Definition at line 972 of file outputs.py.
emit_meta | ( | self | ) |
Outputs source metainfo in one sink, if not already emitted.
Reimplemented from Sink.
Definition at line 964 of file outputs.py.
flush | ( | self | ) |
is_highlighting | ( | self | ) |
Returns whether any sink requires highlighted matches.
Reimplemented from Sink.
Definition at line 1014 of file outputs.py.
validate | ( | self | ) |
Returns whether prerequisites are met for all sinks.
Reimplemented from Sink.
Definition at line 998 of file outputs.py.
|
static |
Autobinding between argument flags and sink classes.
Definition at line 922 of file outputs.py.
|
static |
Autobinding between –write TARGET format=FORMAT
and sink classes.
Definition at line 925 of file outputs.py.
sinks |
List of all combined sinks.
Definition at line 944 of file outputs.py.
valid |
Definition at line 941 of file outputs.py.