from cement import Controller, ex
from cement.utils.version import get_version_banner
from ..core.version import get_version
VERSION_BANNER = """
A weighted ensemble simulation setup tool starting from a BNGL model %s
%s
""" % (
get_version(),
get_version_banner(),
)
[docs]class Base(Controller):
def _default(self):
"""Default action if no sub-command is passed."""
self.app.args.print_help()
[docs] @ex(
help="example sub command1",
# sub-command level arguments. ex: 'webng command1 --foo bar'
arguments=[
### add a sample foo option under subcommand namespace
(
["-f", "--foo"],
{"help": "notorious foo option", "action": "store", "dest": "foo"},
),
],
)
def command1(self):
"""Example sub-command."""
data = {
"foo": "bar",
}
### do something with arguments
if self.app.pargs.foo is not None:
data["foo"] = self.app.pargs.foo
self.app.render(data, "command1.jinja2")