Commit 7af1b803 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

ok for a laod + a process workflow

parent de5c3aa0
...@@ -91,7 +91,7 @@ class Workflow(threading.Thread): ...@@ -91,7 +91,7 @@ class Workflow(threading.Thread):
except: self.engine_arguments = None except: self.engine_arguments = None
try: try:
# Add config information # Add config information
self.name, self.description, self.parameters = self._get_from_config() self.name, self.description, self.parameters = self._get_from_config(self.parameters_section)
except: except:
raise IOError(self.__class__.__name__ + " workflow property file not found or invalid.") raise IOError(self.__class__.__name__ + " workflow property file not found or invalid.")
...@@ -123,15 +123,16 @@ class Workflow(threading.Thread): ...@@ -123,15 +123,16 @@ class Workflow(threading.Thread):
del odict['_Thread__stderr'] del odict['_Thread__stderr']
return odict return odict
def get_parameters_per_groups(self): def get_parameters_per_groups(self, parameters_section="parameters"):
parameters, parameters_order = {}, [] name, description, parameters = self._get_from_config(parameters_section)
for param in self.parameters: pgparameters, parameters_order = {}, []
for param in parameters:
if param.group not in parameters_order: parameters_order.append(param.group) if param.group not in parameters_order: parameters_order.append(param.group)
if parameters.has_key(param.group): if pgparameters.has_key(param.group):
parameters[param.group].append(param) pgparameters[param.group].append(param)
else: else:
parameters[param.group] = [param] pgparameters[param.group] = [param]
return [parameters, parameters_order] return [pgparameters, parameters_order]
def get_exec_path(self, software): def get_exec_path(self, software):
exec_path = self.jflow_config_reader.get_exec(software) exec_path = self.jflow_config_reader.get_exec(software)
...@@ -330,15 +331,15 @@ class Workflow(threading.Thread): ...@@ -330,15 +331,15 @@ class Workflow(threading.Thread):
extended_args[param.name] = param.default extended_args[param.name] = param.default
return extended_args return extended_args
def _get_from_config(self): def _get_from_config(self, parameters_section):
reader = ConfigParser() reader = ConfigParser()
reader.read(self._get_property_path()) reader.read(self._get_property_path())
parameters, param_order = [], [] parameters, param_order = [], []
try: try:
params, sub_order, excludes, hash_params = {}, {}, [], {} params, sub_order, excludes, hash_params = {}, {}, [], {}
# first grab all parameters name # first grab all parameters name
for param in reader.items(self.parameters_section): for param in reader.items(parameters_section):
cvalue = reader.get(self.parameters_section, param[0]) cvalue = reader.get(parameters_section, param[0])
cparam = param[0].split(".")[0] cparam = param[0].split(".")[0]
ckey = ".".join(param[0].split(".")[1:]) ckey = ".".join(param[0].split(".")[1:])
if len(ckey.split(".")) > 1: if len(ckey.split(".")) > 1:
......
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