qiBuild documentation

qisys.script – Tools for qibuild scripts

Functions defined in this module

qisys.script.run_action(module_name, args=None, forward_args=None)

Run an action using its module path and a list of arguments

If forward_args is given, it must be an argparse.Namespace object. This namespace will be merged with args before being passed to the do() method of module_name.

Example of use

# Configure, build, and run tests on the "foo" project:

def do(args):
    # Forward the --release example to every action:
      ["foo"], forward_args=args)
      ["foo"], forward_args=args)
      ["foo"], forward_args=args)
qisys.script.root_command_main(name, parser, modules, args=None)

name : name of the main program parser : an instance of ArgumentParser class modules : list of Python modules


Returns a suitable list of modules from a package.

Example: assuming you have: actions/foo/__init__.py actions/foo/spam.py actions/foo/eggs.py

then action_modules_from_package(“actions.foo”) returns: [actions.foo.spam, actions.foo.eggs]

Example of usage:

parser = argparse.ArgumentParser()
modules = qisys.script.action_modules_from_package("qibuild.actions")
qisys.script.root_command_main("qibuild", parser, modules)