radloggerpy.cli.argument_helper module

class radloggerpy.cli.argument_helper.ArgumentHelper[source]

Bases: object

Simplifies the adding of arguments when using argparse

Implement this abstract class to simplify adding of argparse arguments. Add elements to the arguments dictionary were the key is the desired argument name and the value is an radloggerpy.cli.argument.Argument instance.

To register the arguments defined in arguments call the register_arguments() function passing the desired argparse ArgumentParser instance.

The expected structure of arguments could look as follows:

{ ‘name’ : Argument(), ‘–interface’ : Argument(‘-i’, required=True) }

When the extend of certain Argument parameters is not known at compile time these parameters can be added using radloggerpy.cli.argument.Argument.add_kwarg()

_abc_impl = <_abc._abc_data object>
abstract property arguments: dict

Dictionary property that must be implemented to contain arguments

register_arguments(parser)[source]

Register all arguments in arguments on the parser

Parameters:

parser (argparse.ArgumentParser) – argparse parser for command line strings