Commit 6b5a9845 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Some format refactor

parent fc6390a5
......@@ -128,7 +128,7 @@ class ConditionalRule(SimpleRule):
if which == "ALL" and all_raised:
self.condition_raised = True
self.condition_raised_name = " & ".join(conditions)
self.condition_raised_name = "'" + "' and '".join(conditions) + "'"
@abstractmethod
def check(self):
......@@ -148,7 +148,7 @@ class Exclude(LinkRule):
def check(self):
for exclude in self.targets_args:
if exclude in self.user_args and self.user_args[exclude] is not None: # The target is found
self.error("Parameters " + self.parameter_name + " and " + exclude + " are mutually excluded")
self.error("Parameters '" + self.parameter_name + "' and '" + exclude + "' are mutually excluded")
class ToBeRequired(LinkRule):
......@@ -160,8 +160,8 @@ class ToBeRequired(LinkRule):
for require in self.targets_args:
if require not in self.user_args or (require in self.user_args and self.user_args[require] is None): # The
# target is not found
self.error("Parameter " + self.parameter_name + " require parameter " + require +
" to be defined")
self.error("Parameter '" + self.parameter_name + "' require parameter '" + require +
"' to be defined")
class RequiredIf(ConditionalRule):
......@@ -172,7 +172,7 @@ class RequiredIf(ConditionalRule):
def check(self):
if self.condition_raised:
if self.parameter_name not in self.user_args or not self.user_args[self.parameter_name]:
self.error("Parameter " + self.parameter_name + " is required because: " + self.condition_raised_name)
self.error("Parameter '" + self.parameter_name + "' is required because: " + self.condition_raised_name)
class DisabledIf(ConditionalRule):
......@@ -184,7 +184,7 @@ class DisabledIf(ConditionalRule):
if self.condition_raised and self.parameter_name in self.user_args and \
self.user_args[self.parameter_name] is not None and \
str(self.user_args[self.parameter_name]) != str(self.wf_instance.__dict__[self.parameter_name].default):
self.error("Parameter " + self.parameter_name + " is not available, because: " + self.condition_raised_name)
self.error("Parameter '" + self.parameter_name + "' is not available, because: " + self.condition_raised_name)
class FilesUnique(SimpleRule):
......@@ -204,4 +204,4 @@ class FilesUnique(SimpleRule):
if isinstance(sub_parameter_obj, InputFile) or isinstance(sub_parameter_obj, InputDirectory):
all_files.append(value[0])
if len(set(all_files)) < len(all_files):
self.error("Some files into " + self.parameter_name + " are given several times")
\ No newline at end of file
self.error("Some files into '" + self.parameter_name + "' are given several times")
\ No newline at end of file
......@@ -1269,7 +1269,7 @@ class Workflow(threading.Thread):
rules[parameter.name] = parameter.rules.split(";")
if isinstance(parameter, InputFileList) and parameter.name in user_params:
if len(set(user_params[parameter.name])) < len(user_params[parameter.name]):
raise RuleException("Error for parameter " + parameter.name + ": some files are duplicated")
raise RuleException("Error for parameter '" + parameter.name + "': some files are duplicated")
# Check rules:
for src_arg, arg_rules in rules.items():
......
Supports Markdown
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