Commit 8b8be33e authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Add comments

parent 54f7e79d
......@@ -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):
......
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