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