Namespace for program argument handling.
Definition at line 280 of file common.py.
◆ flatten()
Returns new program argument namespace with list values flattened and deduplicated.
Definition at line 346 of file common.py.
◆ make_parser()
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()
Validates arguments, prints errors, returns success.
@param args arguments object like argparse.Namespace
Definition at line 388 of file common.py.
◆ DEDUPE_UNLESS
| dict DEDUPE_UNLESS = {"PATTERN": "EXPRESSION"} |
|
static |
◆ NO_FLATTENS
| dict NO_FLATTENS = {"WRITE"} |
|
static |
◆ PRECASTS
| dict PRECASTS = {"NTH_INTERVAL": lambda v: import_item("grepros.api").to_sec(v)} |
|
static |
◆ SIGNED_INTS
| dict SIGNED_INTS = {"START_INDEX", "END_INDEX", "START_LINE", "END_LINE"} |
|
static |
◆ STRING_COLLECTIONS
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 |
◆ UNSIGNED_FLOATS
| dict UNSIGNED_FLOATS = {"NTH_INTERVAL", "TIME_SCALE"} |
|
static |
◆ UNSIGNED_INTS
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 |
The documentation for this class was generated from the following file: