from CommandRunner import CommandRunner as Runner import importlib import os def get_modules(): modules = [] for folder in os.listdir("./modules"): #skipping sample module if folder == "sample": continue 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)