Commit 93d885bd authored by Michael Vötter's avatar Michael Vötter
Browse files

Merge branch '58-get-rid-of-argparse' into 'master'

Resolve "get rid of argparse"

Closes #58

See merge request dbis/software/dbispipeline!40
parents 324af920 7bb9c446
Pipeline #42169 passed with stage
in 2 minutes and 6 seconds
"""Declaring the main method of this package."""
import argparse
from dbispipeline.cli.main import main
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='executes dbis config files')
# TODO: configurationfile is required but it is i.e. not needed for restore
parser.add_argument('plan', help='file that holds config')
parser.add_argument('-f',
'--force',
action='store_true',
help='Run with dirty git')
parser.add_argument('--dryrun',
action='store_true',
help='run without sending results to database.')
parser.add_argument(
'-m',
'--mail',
choices=[None, 'run', 'total'],
default=None,
help='Mail notification level. Choose one of [None, \'run\', \'total\''
']. If set no None, no mails will be sent. if set to \'run\', one info'
' mail will be sent for each run. If set to \'total\', one mail will '
'be sent after the entire pipeline is complete.')
parser.add_argument(
'--restore',
default=None,
type=str,
help='Restores the backup contained in the given file.')
parser.add_argument(
'--slurm',
action='store_true',
help='send this job to the slurm job queue instead of running it local'
)
parser.add_argument('-v',
'--verbose',
action='store_true',
help='increase logging')
args = parser.parse_args()
main(args.dryrun, args.force, args.verbose, args.slurm, args.restore,
args.mail, args.plan)
main()
......@@ -30,12 +30,6 @@ from dbispipeline.utils import restore_backup
' mail will be sent for each run. If set to \'total\', one mail will '
'be sent after the entire pipeline is complete.')
@click.argument('plan', type=click.Path(exists=True))
def _main(dryrun, force, verbose, slurm, restore, mail, plan):
main(dryrun, force, verbose, slurm, restore, mail, plan)
# this method is split to allow the legacy method of invoking via the modules'
# __main__.py file to re-use this code.
def main(dryrun, force, verbose, slurm, restore, mail, plan):
"""Entry point that executes the pipeline given a configuration."""
if verbose:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment