1 from __future__
import print_function
2 from builtins
import object
18 from pathlib
import Path
34 for filename
in Path(directory).glob(
"**/*MTT*.py"):
36 modname = filename.stem
39 if "Stage" not in modname
and "Tool" not in modname
and "Utility" not in modname:
44 m = imp.load_source(modname, str(filename))
46 print(
"ERROR: unable to load " + modname +
" from file " + str(filename))
50 cls = getattr(m, modname)
52 if "Stage" in modname:
55 modname = modname[:-8]
56 self.
stages[modname] = a.__class__
58 order = a.__class__().ordering()
62 self.stageOrder.insert(i, modname)
63 self.stageOrderIndices.insert(i, order)
64 elif "Tool" in modname:
67 modname = modname[:-7]
68 self.
tools[modname] = a.__class__
69 elif "Utility" in modname:
72 modname = modname[:-10]
74 except AttributeError: