oasislmf.cli.command

Classes

OasisBaseCommand

The base command to inherit from for each command.

OasisComputationCommand

Eventually, the Parent class for all Oasis Computation Command

Module Contents

class oasislmf.cli.command.OasisBaseCommand(*args, **kwargs)[source]

Bases: argparsetree.BaseCommand

The base command to inherit from for each command.

2 additional arguments (--verbose and --config) are added to the parser so that they are available for all commands.

args = None[source]
log_verbose = False[source]
add_args(parser)[source]

Adds arguments to the argument parser. This is used to modify which arguments are processed by the command.

2 global parameters (--verbose and --config) are added so that they are available to all commands.

Parameters:

parser (ArgumentParser) – The argument parser object

parse_args()[source]

Parses the command line arguments and sets them in self.args

Returns:

The arguments taken from the command line

setup_logger()[source]

The logger to use for the command with the verbosity set

property logger[source]
class oasislmf.cli.command.OasisComputationCommand(*args, **kwargs)[source]

Bases: OasisBaseCommand

Eventually, the Parent class for all Oasis Computation Command create the command line interface from parameter define in the associated computation step

add_args(parser)[source]

Adds arguments to the argument parser.

Parameters:

parser (ArgumentParser) – The argument parser object

action(args)[source]

Generic method that call the correct manager method from the child class computation_name

Parameters:

args (Namespace) – The arguments from the command line