Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
639c6ae4
Commit
639c6ae4
authored
Aug 09, 2013
by
Jerome Mariette
Browse files
fixe a bug when overloading get_config
parent
8805cdf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/jflow_cli.py
View file @
639c6ae4
...
...
@@ -30,14 +30,6 @@ import jflow.utils as utils
from
cctools.util
import
time_format
# Overload the convert_arg_line_to_args to take config files as argument
class
ConfigArgumentParser
(
argparse
.
ArgumentParser
):
def
convert_arg_line_to_args
(
self
,
arg_line
):
for
arg
in
arg_line
.
split
():
if
not
arg
.
strip
():
continue
yield
arg
def
display_workflow_status
(
workflow
,
detailed
=
False
):
if
workflow
.
start_time
:
start_time
=
time
.
asctime
(
time
.
localtime
(
workflow
.
start_time
))
else
:
start_time
=
"-"
...
...
@@ -89,7 +81,7 @@ if __name__ == '__main__':
wfmanager
=
WorkflowsManager
()
# Create the top-level parser
parser
=
Config
ArgumentParser
(
fromfile_prefix_chars
=
'@'
)
parser
=
argparse
.
ArgumentParser
(
fromfile_prefix_chars
=
'@'
)
subparsers
=
parser
.
add_subparsers
(
title
=
'Available sub commands'
)
# Add rerun workflow availability
...
...
@@ -116,9 +108,14 @@ if __name__ == '__main__':
sub_parser
=
subparsers
.
add_parser
(
instance
.
name
,
help
=
instance
.
description
)
for
param
in
instance
.
parameters
:
sub_parser
.
add_argument
(
param
.
flag
,
**
param
.
export_to_argparse
())
sub_parser
.
set_defaults
(
cmd_object
=
instance
.
__class__
.
__name__
)
args
=
vars
(
parser
.
parse_args
())
sub_parser
.
set_defaults
(
cmd_object
=
instance
.
__class__
.
__name__
,
cmd_class
=
instance
.
__class__
)
args
=
vars
(
parser
.
parse_args
())
if
args
.
has_key
(
"cmd_class"
):
# re parse args with the right parser
parser
.
convert_arg_line_to_args
=
args
[
"cmd_class"
].
config_parser
args
=
vars
(
parser
.
parse_args
())
if
args
[
"cmd_object"
]
in
wf_classes
:
wfmanager
.
run_workflow
(
args
[
"cmd_object"
],
args
)
elif
args
[
"cmd_object"
]
==
"rerun"
:
...
...
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