linux-tools/main.py

30 lines
701 B
Python
Raw Normal View History

2019-12-14 04:26:02 +01:00
from CommandRunner import CommandRunnerDebug as Runner
2019-12-14 04:11:32 +01:00
import importlib
import os
def get_modules():
modules = []
for folder in os.listdir("./modules"):
2019-12-14 04:26:02 +01:00
# skipping sample module
2019-12-14 04:13:35 +01:00
if folder == "sample":
2019-12-14 04:54:52 +01:00
continue
2019-12-14 04:26:02 +01:00
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)
2019-12-14 04:26:02 +01:00
modules.append(curr_module.get_module())
2019-12-14 04:11:32 +01:00
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)