Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
grepros.outputs.TextSinkMixin Class Reference
Inheritance diagram for grepros.outputs.TextSinkMixin:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args=None, **kwargs)
 
def format_message (self, msg, highlight=False)
 
def message_to_yaml (self, val, top=(), typename=None)
 

Static Public Attributes

 DEFAULT_ARGS
 Constructor argument defaults. More...
 
string NOCOLOR_HIGHLIGHT_WRAPPERS = "**", "**"
 Default highlight wrappers if not color output. More...
 

Private Member Functions

def _configure (self, args)
 

Private Attributes

 _format_repls
 
 _patterns
 
 _prefix
 
 _styles
 
 _wrapper
 

Detailed Description

Provides message formatting as text.

Definition at line 122 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.outputs.TextSinkMixin.__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.emit_field            message fields to emit if not all
@param   args.noemit_field          message fields to skip in output
@param   args.max_field_lines       maximum number of lines to output 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 in grepros.outputs.ConsoleSink, and grepros.plugins.auto.html.HtmlSink.

Definition at line 134 of file outputs.py.

Member Function Documentation

◆ _configure()

def grepros.outputs.TextSinkMixin._configure (   self,
  args 
)
private
Initializes output settings.

Definition at line 290 of file outputs.py.

◆ format_message()

def grepros.outputs.TextSinkMixin.format_message (   self,
  msg,
  highlight = False 
)
Returns message as formatted string, optionally highlighted for matches if configured.

Reimplemented in grepros.plugins.auto.html.HtmlSink.

Definition at line 162 of file outputs.py.

◆ message_to_yaml()

def grepros.outputs.TextSinkMixin.message_to_yaml (   self,
  val,
  top = (),
  typename = None 
)
Returns ROS message or other value as YAML.

Definition at line 202 of file outputs.py.

Member Data Documentation

◆ _format_repls

grepros.outputs.TextSinkMixin._format_repls
private

Definition at line 156 of file outputs.py.

◆ _patterns

grepros.outputs.TextSinkMixin._patterns
private

Definition at line 155 of file outputs.py.

◆ _prefix

grepros.outputs.TextSinkMixin._prefix
private

Definition at line 153 of file outputs.py.

◆ _styles

grepros.outputs.TextSinkMixin._styles
private

Definition at line 157 of file outputs.py.

◆ _wrapper

grepros.outputs.TextSinkMixin._wrapper
private

Definition at line 154 of file outputs.py.

◆ DEFAULT_ARGS

grepros.outputs.TextSinkMixin.DEFAULT_ARGS
static
Initial value:
= dict(COLOR=True, EMIT_FIELD=(), NOEMIT_FIELD=(), HIGHLIGHT=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 129 of file outputs.py.

◆ NOCOLOR_HIGHLIGHT_WRAPPERS

string grepros.outputs.TextSinkMixin.NOCOLOR_HIGHLIGHT_WRAPPERS = "**", "**"
static

Default highlight wrappers if not color output.

Definition at line 126 of file outputs.py.


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


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30