Commit 87608adf authored by Jerome Mariette's avatar Jerome Mariette
Browse files

change components for components_to_exec

parent 7401ca13
...@@ -70,7 +70,7 @@ class Workflow(threading.Thread): ...@@ -70,7 +70,7 @@ class Workflow(threading.Thread):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.jflow_config_reader = JFlowConfigReader() self.jflow_config_reader = JFlowConfigReader()
self.manager = WorkflowsManager() self.manager = WorkflowsManager()
self.components = [] self.components_to_exec = []
self.makes = {} self.makes = {}
self.globals = {} self.globals = {}
self.options = Options() self.options = Options()
...@@ -171,7 +171,7 @@ class Workflow(threading.Thread): ...@@ -171,7 +171,7 @@ class Workflow(threading.Thread):
# if already init, add the component to the list and check if weaver should be executed # if already init, add the component to the list and check if weaver should be executed
if self.component_nameids_is_init: if self.component_nameids_is_init:
# add the component # add the component
self.components.append(cmpt_object) self.components_to_exec.append(cmpt_object)
self._execute_weaver() self._execute_weaver()
# update outputs # update outputs
for output in cmpt_object.get_dynamic_outputs(): for output in cmpt_object.get_dynamic_outputs():
...@@ -181,16 +181,16 @@ class Workflow(threading.Thread): ...@@ -181,16 +181,16 @@ class Workflow(threading.Thread):
raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " + raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " +
cmpt_object.prefix + " already exist in this pipeline!") cmpt_object.prefix + " already exist in this pipeline!")
self.component_nameids[cmpt_object.get_nameid()] = None self.component_nameids[cmpt_object.get_nameid()] = None
self.components = [] self.components_to_exec = []
else: else:
if self.component_nameids_is_init: if self.component_nameids_is_init:
# add the component # add the component
self.components.append(cmpt_object) self.components_to_exec.append(cmpt_object)
elif not self.component_nameids_is_init and not self.dynamic_component_present: elif not self.component_nameids_is_init and not self.dynamic_component_present:
if self._component_is_duplicated(cmpt_object): if self._component_is_duplicated(cmpt_object):
raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " + raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " +
cmpt_object.prefix + " already exist in this pipeline!") cmpt_object.prefix + " already exist in this pipeline!")
self.components.append(cmpt_object) self.components_to_exec.append(cmpt_object)
else: else:
if self._component_is_duplicated(cmpt_object): if self._component_is_duplicated(cmpt_object):
raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " + raise ValueError("Component " + cmpt_object.__class__.__name__ + " with prefix " +
...@@ -270,7 +270,7 @@ class Workflow(threading.Thread): ...@@ -270,7 +270,7 @@ class Workflow(threading.Thread):
self.end_time = time.time() self.end_time = time.time()
self._serialize() self._serialize()
raise raise
if len(self.components) > 0: if len(self.components_to_exec) > 0:
self._execute_weaver() self._execute_weaver()
self.step = 3 self.step = 3
self._serialize() self._serialize()
...@@ -557,7 +557,7 @@ class Workflow(threading.Thread): ...@@ -557,7 +557,7 @@ class Workflow(threading.Thread):
with self.options: with self.options:
if new_make: if new_make:
try: try:
for component in self.components: for component in self.components_to_exec:
nest.symbol = component.get_nameid() nest.symbol = component.get_nameid()
nest.batch = component.batch_options nest.batch = component.batch_options
self.component_nameids[component.get_nameid()] = os.path.join(current_working_directory, self.MAKEFLOW_LOG_FILE_NAME) self.component_nameids[component.get_nameid()] = os.path.join(current_working_directory, self.MAKEFLOW_LOG_FILE_NAME)
...@@ -569,7 +569,7 @@ class Workflow(threading.Thread): ...@@ -569,7 +569,7 @@ class Workflow(threading.Thread):
self.end_time = time.time() self.end_time = time.time()
self._serialize() self._serialize()
raise raise
self.components = [] self.components_to_exec = []
# Once a weaver script is compiled, serialize the workflow # Once a weaver script is compiled, serialize the workflow
self._serialize() self._serialize()
try: try:
...@@ -582,7 +582,7 @@ class Workflow(threading.Thread): ...@@ -582,7 +582,7 @@ class Workflow(threading.Thread):
def _get_current_make(self): def _get_current_make(self):
current_component, make_directory, new_make = [], None, False current_component, make_directory, new_make = [], None, False
for component in self.components: for component in self.components_to_exec:
current_component.append(component.get_nameid()) current_component.append(component.get_nameid())
for make in self.makes: for make in self.makes:
if set(current_component) == set(self.makes[make]): if set(current_component) == set(self.makes[make]):
......
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