Defining Command-line tools

Each ænet tool is implemented in a separate file named aenet_*.py in aenet/commandline/, implementing a class that inherits from the abstract base class aenet.commandline.tools.AenetToolABC.

If the naming convention aenet_*.py is followed, the commandline tool will be automatically discovered and added as a subparser to the aenet comand.

API Reference

class aenet.commandline.tools.AenetToolABC(subparsers=None)[source]
subparsers

an instance of an argparse subparsers

_man()[source]

The return value of this private method is the manual entry to be added to the tool’s help message (i.e., shown when the --help flag is passed).

_set_arguments()[source]

Use this method to add command line argument parsers to self.parser.

Example:

self.parser.add_argument(

“–path”, help=”Path to somewhere (default: .).”, default=”.”)

abstractmethod run(args)[source]
Parameters:

args – object returned from an ‘argparse’ parser