Public Member Functions | |
def | __init__ (self, args=None, **kwargs) |
def | close (self) |
def | close_output (self) |
def | emit (self, topic, msg, stamp=None, match=None, index=None) |
def | flush (self) |
def | format_message (self, msg, highlight=False) |
def | is_highlighting (self) |
def | validate (self) |
![]() | |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_value, traceback) |
def | autodetect (cls, target) |
def | bind (self, source) |
def | emit_meta (self) |
def | thread_excepthook (self, text, exc) |
![]() | |
def | ensure_rollover (self, topic, msg, stamp) |
def | format_output_meta (self) |
def | get_write_options (cls, label) |
def | make_filename (self) |
def | size (self) |
![]() | |
def | message_to_yaml (self, val, top=(), typename=None) |
Public Attributes | |
filename | |
valid | |
![]() | |
args | |
source | |
inputs.Source instance bound to this sink More... | |
valid | |
Result of validate() More... | |
![]() | |
filename | |
Current output file path. More... | |
Static Public Attributes | |
DEFAULT_ARGS | |
Constructor argument defaults. More... | |
tuple | FILE_EXTENSIONS = (".htm", ".html") |
Auto-detection file extensions. More... | |
TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "html.tpl") | |
HTML template path. More... | |
int | WRAP_WIDTH = 120 |
Character wrap width for message YAML. More... | |
![]() | |
DEFAULT_ARGS = dict(META=False) | |
Constructor argument defaults. More... | |
tuple | FILE_EXTENSIONS = () |
Auto-detection file extensions for subclasses, as (".ext", ) More... | |
![]() | |
DEFAULT_ARGS = dict(VERBOSE=False, WRITE=None, WRITE_OPTIONS={}) | |
Constructor argument defaults. More... | |
string | FILE_META_TEMPLATE = "{name} ({size})" |
string | MULTI_META_TEMPLATE = "\n- {name} ({size}, {mcount}, {tcount})" |
list | OPTIONS_TEMPLATES |
Command-line help templates for rollover options, as [(name, text with s label placeholder)]. More... | |
string | START_META_TEMPLATE = "{mcount} in {tcount} to " |
![]() | |
DEFAULT_ARGS | |
Constructor argument defaults. More... | |
string | NOCOLOR_HIGHLIGHT_WRAPPERS = "**", "**" |
Default highlight wrappers if not color output. More... | |
Private Member Functions | |
def | _produce (self) |
def | _stream (self) |
Private Attributes | |
_close_printed | |
_overwrite | |
_queue | |
_tag_repls | |
_tag_rgx | |
_template_path | |
_writer | |
def grepros.plugins.auto.html.HtmlSink.__init__ | ( | self, | |
args = None , |
|||
** | kwargs | ||
) |
@param args arguments as namespace or dictionary, case-insensitive; or a single path as the name of HTML file to write @param args.write name of HTML file to write, will add counter like .2 to filename if exists @param args.write_options ``` {"template": path to custom HTML template, if any, "overwrite": whether to overwrite existing file (default false), "rollover-size": bytes limit for individual output files, "rollover-count": message limit for individual output files, "rollover-duration": time span limit for individual output files, as ROS duration or convertible seconds, "rollover-template": output filename template, supporting strftime format codes like "%H-%M-%S" and "%(index)s" as output file index} ``` @param args.highlight highlight matched values (default true) @param args.orderby "topic" or "type" if any to group results by @param args.color False or "never" for not using colors in replacements @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 args.meta whether to emit metainfo @param args.verbose whether to emit debug information @param kwargs any and all arguments as keyword overrides, case-insensitive
Reimplemented from grepros.outputs.Sink.
|
private |
|
private |
def grepros.plugins.auto.html.HtmlSink.close | ( | self | ) |
Closes output file, if any, emits metainfo.
Reimplemented from grepros.outputs.Sink.
def grepros.plugins.auto.html.HtmlSink.close_output | ( | self | ) |
Closes output file, if any.
Reimplemented from grepros.outputs.RolloverSinkMixin.
def grepros.plugins.auto.html.HtmlSink.emit | ( | self, | |
topic, | |||
msg, | |||
stamp = None , |
|||
match = None , |
|||
index = None |
|||
) |
Writes message to output file.
Reimplemented from grepros.outputs.Sink.
def grepros.plugins.auto.html.HtmlSink.flush | ( | self | ) |
Writes out any pending data to disk.
Reimplemented from grepros.outputs.Sink.
def grepros.plugins.auto.html.HtmlSink.format_message | ( | self, | |
msg, | |||
highlight = False |
|||
) |
Returns message as formatted string, optionally highlighted for matches if configured.
Reimplemented from grepros.outputs.TextSinkMixin.
def grepros.plugins.auto.html.HtmlSink.is_highlighting | ( | self | ) |
Returns True if sink is configured to highlight matched values.
Reimplemented from grepros.outputs.Sink.
def grepros.plugins.auto.html.HtmlSink.validate | ( | self | ) |
Returns whether write options are valid and ROS environment is set and file is writable, emits error if not.
Reimplemented from grepros.outputs.Sink.
|
static |
Constructor argument defaults.
|
static |
|
static |
|
static |