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

Classes

class  HelpFormatter
 

Public Member Functions

 flatten (cls, args)
 
 make_parser (cls, arguments, formatter=HelpFormatter)
 
 process_types (cls, args)
 
 transform (cls, args, cli=False)
 
 validate (cls, args, cli=False)
 
 verify (cls, args)
 

Static Public Attributes

dict DEDUPE_UNLESS = {"PATTERN": "EXPRESSION"}
 
dict NO_FLATTENS = {"WRITE"}
 
dict PRECASTS = {"NTH_INTERVAL": lambda v: import_item("grepros.api").to_sec(v)}
 
dict SIGNED_INTS = {"START_INDEX", "END_INDEX", "START_LINE", "END_LINE"}
 
dict STRING_COLLECTIONS
 
dict STRINGS = {"PUBLISH_PREFIX", "PUBLISH_SUFFIX", "PUBLISH_FIXNAME"}
 
dict UNSIGNED_FLOATS = {"NTH_INTERVAL", "TIME_SCALE"}
 
dict UNSIGNED_INTS
 
dict UNSIGNED_WHEN = {"START_INDEX": "LIVE", "END_INDEX": "LIVE"}
 

Detailed Description

Namespace for program argument handling.

Definition at line 280 of file common.py.

Member Function Documentation

◆ flatten()

flatten (   cls,
  args 
)
Returns new program argument namespace with list values flattened and deduplicated.

Definition at line 346 of file common.py.

◆ make_parser()

make_parser (   cls,
  arguments,
  formatter = HelpFormatter 
)
Returns a configured ArgumentParser instance for program arguments.

@param  arguments  argparse options as {description, epilog, arguments: [], groups: []}
@param  formatter  help formatter class to use

Definition at line 311 of file common.py.

◆ process_types()

process_types (   cls,
  args 
)
Converts and validates types in argument namespace, returns list of errors, if any.

Definition at line 422 of file common.py.

◆ transform()

transform (   cls,
  args,
  cli = False 
)
Sets command-line specific flag state to program argument namespace.

Definition at line 361 of file common.py.

◆ validate()

validate (   cls,
  args,
  cli = False 
)
Converts and validates program argument namespace, prints and raises on error.

Returns new namespace with arguments in expected type and form.

Definition at line 332 of file common.py.

◆ verify()

verify (   cls,
  args 
)
Validates arguments, prints errors, returns success.

@param   args  arguments object like argparse.Namespace

Definition at line 388 of file common.py.

Member Data Documentation

◆ DEDUPE_UNLESS

dict DEDUPE_UNLESS = {"PATTERN": "EXPRESSION"}
static

Definition at line 295 of file common.py.

◆ NO_FLATTENS

dict NO_FLATTENS = {"WRITE"}
static

Definition at line 291 of file common.py.

◆ PRECASTS

dict PRECASTS = {"NTH_INTERVAL": lambda v: import_item("grepros.api").to_sec(v)}
static

Definition at line 294 of file common.py.

◆ SIGNED_INTS

dict SIGNED_INTS = {"START_INDEX", "END_INDEX", "START_LINE", "END_LINE"}
static

Definition at line 287 of file common.py.

◆ STRING_COLLECTIONS

dict STRING_COLLECTIONS
static
Initial value:
= {"TOPIC", "SKIP_TOPIC", "TYPE", "SKIP_TYPE", "SELECT_FIELD",
"NO_SELECT_FIELD", "EMIT_FIELD", "NO_EMIT_FIELD", "MATCH_WRAPPER"}

Definition at line 289 of file common.py.

◆ STRINGS

dict STRINGS = {"PUBLISH_PREFIX", "PUBLISH_SUFFIX", "PUBLISH_FIXNAME"}
static

Definition at line 288 of file common.py.

◆ UNSIGNED_FLOATS

dict UNSIGNED_FLOATS = {"NTH_INTERVAL", "TIME_SCALE"}
static

Definition at line 286 of file common.py.

◆ UNSIGNED_INTS

dict UNSIGNED_INTS
static
Initial value:
= {"NTH_MESSAGE", "NTH_MATCH", "MAX_COUNT", "MAX_PER_TOPIC", "MAX_TOPICS",
"BEFORE", "AFTER", "CONTEXT", "LINES_AROUND_MATCH", "MAX_FIELD_LINES",
"MAX_MESSAGE_LINES", "WRAP_WIDTH", "QUEUE_SIZE_IN", "QUEUE_SIZE_OUT"}

Definition at line 283 of file common.py.

◆ UNSIGNED_WHEN

dict UNSIGNED_WHEN = {"START_INDEX": "LIVE", "END_INDEX": "LIVE"}
static

Definition at line 293 of file common.py.


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