Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institut für Informatik
dbis
software
dbispipeline
Commits
7bb9c446
Commit
7bb9c446
authored
Mar 11, 2021
by
Benjamin Murauer
Committed by
Michael Vötter
Mar 11, 2021
Browse files
Resolve "get rid of argparse"
parent
324af920
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
44 deletions
+1
-44
src/dbispipeline/__main__.py
src/dbispipeline/__main__.py
+1
-38
src/dbispipeline/cli/main.py
src/dbispipeline/cli/main.py
+0
-6
No files found.
src/dbispipeline/__main__.py
View file @
7bb9c446
"""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
()
src/dbispipeline/cli/main.py
View file @
7bb9c446
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment