Skip to content
Snippets Groups Projects

Adapt code for the lbexec command (incl. removal of run-mc)

Merged Davide Fazzini requested to merge dfazzini_adapt_code_for_lbexec into master
3 files
+ 28
27
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 14
17
@@ -48,13 +48,13 @@ class DefaultCommandGroup(click.Group):
def command(self, *args, **kwargs):
default_command = kwargs.pop('default_command', False)
if default_command and not args:
kwargs['name'] = kwargs.get('name', '_')
decorator = super(
DefaultCommandGroup, self).command(*args, **kwargs)
decorator = super(DefaultCommandGroup, self).command(*args, **kwargs)
if default_command:
def new_decorator(f):
cmd = decorator(f)
self.default_command = cmd.name
@@ -76,8 +76,7 @@ class DefaultCommandGroup(click.Group):
try:
# test if the command parses
return super(
DefaultCommandGroup, self).resolve_command(ctx, args)
return super(DefaultCommandGroup, self).resolve_command(ctx, args)
except click.UsageError:
# command did not parse, assume it is the default command
args.insert(0, self.default_command)
@@ -85,8 +84,7 @@ class DefaultCommandGroup(click.Group):
ctx.params = params_bak
ctx.args = args_bak
return super(
DefaultCommandGroup, self).resolve_command(ctx, args)
return super(DefaultCommandGroup, self).resolve_command(ctx, args)
inputfiledb_helper = "TestFileDB-like file containing job input and conditions information (.yaml). Takes the pair of values 'filedb-key', 'filedb-path'." \
@@ -99,12 +97,10 @@ simplejob_helper = "Option for running a simple DaVinci job without any specific
override_data_options_helper = "Allow overriding default data options defined in DaVinci Database."
@click.group(cls=DefaultCommandGroup,
invoke_without_command=True,
context_settings=dict(
ignore_unknown_options=True,
allow_extra_args=True)
)
@click.group(
cls=DefaultCommandGroup,
invoke_without_command=True,
context_settings=dict(ignore_unknown_options=True, allow_extra_args=True))
@click.version_option(version=APP_VERSION)
@click.option(
"-o",
@@ -196,9 +192,9 @@ def run_job(configurables, export=None, with_defaults=False, dry_run=None):
exit(app.run())
@main.command(default_command=True,
context_settings=dict(
ignore_unknown_options=True, allow_extra_args=True))
@main.command(
default_command=True,
context_settings=dict(ignore_unknown_options=True, allow_extra_args=True))
@click.option(
"-i",
"--inputfiledb",
@@ -214,7 +210,8 @@ def run_job(configurables, export=None, with_defaults=False, dry_run=None):
default=False,
help=override_data_options_helper)
@click.pass_context
def main_command(ctx, inputfiledb, joboptfile, simplejob, override_data_options):
def main_command(ctx, inputfiledb, joboptfile, simplejob,
override_data_options):
"""
Default command for running a DaVinci job.
Loading