Skip to content
GitLab
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
8b8be33e
Commit
8b8be33e
authored
Oct 24, 2016
by
Floreal Cabanettes
Browse files
Add comments
parent
54f7e79d
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/jflow_cli.py
View file @
8b8be33e
...
...
@@ -66,6 +66,8 @@ def _check_rule(rule: str, src_arg: str, user_args: dict, parameters: dict, all_
@param all_files: all files given by the user
"""
from
jflow.parameter
import
InputFileList
,
InputFile
,
InputDirectory
print
(
src_arg
)
print
(
user_args
[
src_arg
])
# Rule: Unique
if
rule
==
"unique"
:
...
...
@@ -109,12 +111,14 @@ def _check_rule(rule: str, src_arg: str, user_args: dict, parameters: dict, all_
if
match
:
conditions
=
match
.
group
(
1
).
split
(
","
)
excludes
=
match
.
group
(
2
).
split
(
","
)
# Check condition is raised:
condition_raised
=
None
for
condition
in
conditions
:
if
(
condition
[
0
]
==
"!"
and
user_args
[
src_arg
]
!=
condition
[
1
:])
or
(
condition
[
0
]
!=
"!"
and
str
(
user_args
[
src_arg
])
==
str
(
condition
)):
condition_raised
=
condition
break
# Apply rule if true:
if
condition_raised
is
not
None
:
for
exclude
in
excludes
:
if
exclude
in
user_args
and
user_args
[
exclude
]
is
not
None
:
...
...
@@ -147,12 +151,14 @@ def _check_rule(rule: str, src_arg: str, user_args: dict, parameters: dict, all_
if
match
:
conditions
=
match
.
group
(
1
).
split
(
","
)
requires
=
match
.
group
(
2
).
split
(
","
)
# Check condition is raised:
condition_raised
=
None
for
condition
in
conditions
:
if
(
condition
[
0
]
==
"!"
and
user_args
[
src_arg
]
!=
condition
[
1
:])
or
(
condition
[
0
]
!=
"!"
and
str
(
user_args
[
src_arg
])
==
str
(
condition
)):
condition_raised
=
condition
break
# Apply rule if true:
if
condition_raised
is
not
None
:
for
require
in
requires
:
if
require
not
in
user_args
or
(
require
in
user_args
and
user_args
[
require
]
is
None
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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