|
| | __init__ (self, args=None, **kwargs) |
| |
| | __enter__ (self) |
| |
| | __exit__ (self, exc_type, exc_value, traceback) |
| |
| | find (self, source, highlight=None) |
| |
| | get_match (self, msg) |
| |
| | match (self, topic, msg, stamp, highlight=None) |
| |
| | validate (self, reset=False) |
| |
| | work (self, source, sink) |
| |
|
| list | ANY_MATCHES = [((), re.compile("(.*)", re.DOTALL)), (), re.compile("(.?)", re.DOTALL)] |
| | Match patterns for global any-match.
|
| |
| | DEFAULT_ARGS |
| | Constructor argument defaults.
|
| |
| | GrepMessage = collections.namedtuple("BagMessage", "topic message timestamp match index") |
| | Namedtuple of (topic name, ROS message, ROS time object, message if matched, index in topic).
|
| |
ROS message grepper.
In highlighted results, message field values that match search criteria are modified
to wrap the matching parts in {@link grepros.common.MatchMarkers MatchMarkers} tags,
with numeric field values converted to strings beforehand.
Definition at line 29 of file search.py.
| __init__ |
( |
|
self, |
|
|
|
args = None, |
|
|
** |
kwargs |
|
) |
| |
@param args arguments as namespace or dictionary, case-insensitive
@param args.pattern pattern(s) to find in message field values
@param args.fixed_string pattern contains ordinary strings, not regular expressions
@param args.case use case-sensitive matching in pattern
@param args.invert select messages not matching pattern
@param args.expression pattern(s) are a logical expression
like 'this AND (this2 OR NOT "skip this")',
with elements as patterns to find in message fields
@param args.highlight highlight matched values
@param args.before number of messages of leading context to emit before match
@param args.after number of messages of trailing context to emit after match
@param args.context number of messages of leading and trailing context to emit
around match, overrides args.before and args.after
@param args.max_count number of matched messages to emit (per file if bag input)
@param args.max_per_topic number of matched messages to emit from each topic
@param args.max_topics number of topics to emit matches from
@param args.nth_match emit every Nth match in topic, starting from first
@param args.select_field message fields to use in matching if not all
@param args.noselect_field message fields to skip in matching
@param args.match_wrapper string to wrap around matched values in find() and match(),
both sides if one value, start and end if more than one,
or no wrapping if zero values (default "**")
@param kwargs any and all arguments as keyword overrides, case-insensitive
<!--sep-->
Additional arguments when using match() or find(grepros.api.Bag):
@param args.topic ROS topics to read if not all
@param args.type ROS message types to read if not all
@param args.skip_topic ROS topics to skip
@param args.skip_type ROS message types to skip
@param args.start_time earliest timestamp of messages to read
@param args.end_time latest timestamp of messages to read
@param args.start_index message index within topic to start from
@param args.end_index message index within topic to stop at
@param args.unique emit messages that are unique in topic
@param args.nth_message read every Nth message in topic, starting from first
@param args.nth_interval minimum time interval between messages in topic,
as seconds or ROS duration
@param args.condition Python expressions that must evaluate as true
for message to be processable, see ConditionMixin
@param args.progress whether to print progress bar
@param args.stop_on_error stop execution on any error like unknown message type
Definition at line 51 of file search.py.
| find |
( |
|
self, |
|
|
|
source, |
|
|
|
highlight = None |
|
) |
| |
Yields matched and context messages from source.
@param source inputs.Source or api.Bag instance
@param highlight whether to highlight matched values in message fields,
defaults to flag from constructor
@return GrepMessage namedtuples of
(topic, message, timestamp, match, index in topic),
where match is matched optionally highlighted message
or `None` if yielding a context message
Definition at line 131 of file search.py.