Namespace for program argument handling.
More...
|
class | HelpFormatter |
| RawTextHelpFormatter returning custom metavar for non-flattenable list arguments. More...
|
|
|
| flatten (cls, args) |
| Returns new program argument namespace with list values flattened and deduplicated.
|
|
| make_parser (cls, arguments, formatter=HelpFormatter) |
| Returns a configured ArgumentParser instance for program arguments.
|
|
| process_types (cls, args) |
| Converts and validates types in argument namespace, returns list of errors, if any.
|
|
| transform (cls, args, cli=False) |
| Sets command-line specific flag state to program argument namespace.
|
|
| validate (cls, args, cli=False) |
| Converts and validates program argument namespace, prints and raises on error.
|
|
| verify (cls, args) |
| Validates arguments, prints errors, returns success.
|
|
Namespace for program argument handling.
Definition at line 289 of file common.py.
◆ flatten()
Returns new program argument namespace with list values flattened and deduplicated.
Definition at line 357 of file common.py.
◆ make_parser()
Returns a configured ArgumentParser instance for program arguments.
- Parameters
-
arguments | argparse options as {description, epilog, arguments: [], groups: []} |
formatter | help formatter class to use |
Definition at line 328 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 433 of file common.py.
◆ transform()
transform |
( |
|
cls, |
|
|
|
args, |
|
|
|
cli = False |
|
) |
| |
Sets command-line specific flag state to program argument namespace.
Definition at line 372 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 348 of file common.py.
◆ verify()
Validates arguments, prints errors, returns success.
- Parameters
-
args | arguments object like argparse.Namespace |
Definition at line 404 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 298 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 292 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: