grepros 1.3.0
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
ConsoleSink Class Reference
Inheritance diagram for ConsoleSink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 
 emit_meta (self)
 
 is_highlighting (self)
 
 validate (self)
 
- Public Member Functions inherited from Sink
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 autodetect (cls, target)
 
 bind (self, source)
 
 close (self)
 
 configure (self, args=None, **kwargs)
 
 flush (self)
 
 thread_excepthook (self, text, exc)
 
- Public Member Functions inherited from TextSinkMixin
 format_message (self, msg, highlight=False)
 
 message_to_yaml (self, val, top=(), typename=None)
 

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.
 

Detailed Description

Prints messages to console.

Definition at line 534 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
**  kwargs 
)
@param   args                       arguments as namespace or dictionary, case-insensitive
@param   args.color                 False or "never" for not using colors in replacements
@param   args.highlight             highlight matched values (default true)
@param   args.meta                  whether to print metainfo
@param   args.emit_field            message fields to emit if not all
@param   args.noemit_field          message fields to skip in output
@param   args.line_prefix           print source prefix like bag filename on each message line
@param   args.max_field_lines       maximum number of lines to print per field
@param   args.start_line            message line number to start output from
@param   args.end_line              message line number to stop output at
@param   args.max_message_lines     maximum number of lines to output per message
@param   args.lines_around_match    number of message lines around matched fields to output
@param   args.matched_fields_only   output only the fields where match was found
@param   args.wrap_width            character width to wrap message YAML output at
@param   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
@param   kwargs                     any and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 551 of file outputs.py.

Member Function Documentation

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Prints separator line and message text.

Reimplemented from Sink.

Definition at line 589 of file outputs.py.

◆ emit_meta()

emit_meta (   self)
Prints source metainfo like bag header, if not already printed.

Reimplemented from Sink.

Definition at line 577 of file outputs.py.

◆ is_highlighting()

is_highlighting (   self)
Returns True if sink is configured to highlight matched values.

Reimplemented from Sink.

Definition at line 611 of file outputs.py.

◆ validate()

validate (   self)
Returns whether arguments environment set, populates options, emits error if not.

Reimplemented from Sink.

Definition at line 616 of file outputs.py.

Member Data Documentation

◆ CONTEXT_PREFIX_SEP

str CONTEXT_PREFIX_SEP = "-"
static

Definition at line 541 of file outputs.py.

◆ DEFAULT_ARGS

DEFAULT_ARGS
static
Initial value:
= dict(COLOR=True, EMIT_FIELD=(), NOEMIT_FIELD=(), HIGHLIGHT=True, META=False,
LINE_PREFIX=True, MAX_FIELD_LINES=None, START_LINE=None,
END_LINE=None, MAX_MESSAGE_LINES=None, LINES_AROUND_MATCH=None,
MATCHED_FIELDS_ONLY=False, WRAP_WIDTH=None, MATCH_WRAPPER=None)

Constructor argument defaults.

Definition at line 545 of file outputs.py.

◆ MATCH_PREFIX_SEP

str MATCH_PREFIX_SEP = ":"
static

Definition at line 540 of file outputs.py.

◆ MESSAGE_SEP_TEMPLATE

str MESSAGE_SEP_TEMPLATE = "{ll0}{sep}{ll1}"
static

Definition at line 538 of file outputs.py.

◆ META_LINE_TEMPLATE

str META_LINE_TEMPLATE = "{ll0}{sep} {line}{ll1}"
static

Definition at line 537 of file outputs.py.

◆ PREFIX_TEMPLATE

str PREFIX_TEMPLATE = "{pfx0}{batch}{pfx1}{sep0}{sep}{sep1}"
static

Definition at line 539 of file outputs.py.

◆ SEP

str SEP = "---"
static

Definition at line 542 of file outputs.py.

◆ valid

valid

Definition at line 621 of file outputs.py.


The documentation for this class was generated from the following file: