2019-12-14 04:11:32 +01:00
|
|
|
from CommandRunner import CommandRunner as Runner
|
|
|
|
import importlib
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
def get_modules():
|
|
|
|
modules = []
|
|
|
|
for folder in os.listdir("./modules"):
|
2019-12-14 04:13:35 +01:00
|
|
|
#skipping sample module
|
|
|
|
if folder == "sample":
|
|
|
|
continue
|
|
|
|
|
2019-12-14 04:11:32 +01:00
|
|
|
print("Module found: " + folder)
|
|
|
|
curr_module = importlib.import_module('.' + folder, package="modules")
|
|
|
|
print("Try to load module: " + folder)
|
|
|
|
modules.append(curr_module.getModule())
|
|
|
|
print("Module loaded successfully: " + folder)
|
|
|
|
return modules
|
|
|
|
|
|
|
|
|
|
|
|
print("Loading modules: \n")
|
|
|
|
|
|
|
|
modules = get_modules()
|
|
|
|
|
|
|
|
print("\nRunning all modules \n")
|
|
|
|
|
|
|
|
cmdRunner = Runner()
|
|
|
|
for module in modules:
|
|
|
|
cmdRunner.run(module)
|