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

No commit message

No commit message
parent ad0accdd
......@@ -26,6 +26,7 @@ import time
import threading
from ConfigParser import ConfigParser, NoOptionError
import types
import logging
import jflow
import jflow.utils as utils
......@@ -402,17 +403,23 @@ class Workflow(threading.Thread):
pipeline_dir = os.path.dirname(inspect.getfile(self.__class__))
for importer, modname, ispkg in pkgutil.iter_modules([os.path.join(pipeline_dir, "components")], "workflows." +
os.path.basename(pipeline_dir) + ".components."):
m = __import__(modname)
for class_name, obj in inspect.getmembers(sys.modules[modname], inspect.isclass):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
try:
m = __import__(modname)
for class_name, obj in inspect.getmembers(sys.modules[modname], inspect.isclass):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
except:
logging.getLogger("Workflow._import_components").debug("Component <{0}> cannot be loaded".format(modname))
# finally import workflows shared packages
workflows_dir = os.path.dirname(os.path.dirname(inspect.getfile(self.__class__)))
for importer, modname, ispkg in pkgutil.iter_modules([os.path.join(workflows_dir, "components")], "workflows.components."):
m = __import__(modname)
for class_name, obj in inspect.getmembers(sys.modules[modname], inspect.isclass):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
try:
m = __import__(modname)
for class_name, obj in inspect.getmembers(sys.modules[modname], inspect.isclass):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
except:
logging.getLogger("Workflow._import_components").debug("Component <{0}> cannot be loaded".format(modname))
return pckge
def _import(self, module, symbols):
......
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