oasislmf.cli.command

Module Contents

Classes

OasisBaseCommand

The base command to inherit from for each command.

OasisComputationCommand

Eventually, the Parent class for all Oasis Computation Command

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.

property logger[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

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