Commit bc5edc7d authored by Jerome Mariette's avatar Jerome Mariette
Browse files

handle errors when not adding a loaded component

parent 59a9f93b
......@@ -111,6 +111,7 @@ class Workflow(threading.Thread):
def add_component(self, component_name, args=[], kwargs={}, component_prefix="default"):
# first build and check if this component is OK
if self.comp_pckg.has_key(component_name):
my_pckge = __import__(self.comp_pckg[component_name], globals(), locals(), [component_name], -1)
# build the object and define required field
cmpt_object = getattr(my_pckge, component_name)()
......@@ -134,6 +135,9 @@ class Workflow(threading.Thread):
return cmpt_object
sys.exit(component_name + " component cannot be loaded, available components are: " + ", ".join(self.comp_pckg.keys()))
def pre_process(self):
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