Commit c4aad1c6 by Josué A

Added support for loading classes by providing a class reference.

parent 3de3a25b
......@@ -53,9 +53,12 @@ class SchedulerInfo(object):
try:
clas = None
if self.clas:
name = self.clas.rsplit('.', 1)[1]
importlib.import_module(self.clas)
clas = getattr(importlib.import_module(self.clas), name)
if type(self.clas) is type:
clas = self.clas
else:
name = self.clas.rsplit('.', 1)[1]
importlib.import_module(self.clas)
clas = getattr(importlib.import_module(self.clas), name)
elif self.filename:
path, name = os.path.split(self.filename)
name = os.path.splitext(name)[0]
......
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 sign in to comment