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
|
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
print("Loading modules")
|
|
|
|
modules = {}
|
|
|
|
for folder in os.listdir("./modules"):
|
2019-12-15 07:32:28 +01:00
|
|
|
try:
|
|
|
|
curr_module = importlib.import_module('.' + folder, package="modules")
|
|
|
|
modules[folder] = curr_module.get_module()
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
2019-12-15 06:31:18 +01:00
|
|
|
print("Modules loaded successfully.\n")
|
2019-12-14 04:11:32 +01:00
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
print("Available Modules:")
|
|
|
|
for mod in modules.keys():
|
|
|
|
print(mod)
|
2019-12-14 04:26:02 +01:00
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
print()
|
2019-12-14 04:11:32 +01:00
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
while True:
|
|
|
|
chosen_module = input("Please specify your module: ")
|
|
|
|
if chosen_module in modules.keys():
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
print("Module was not found.")
|
2019-12-14 04:11:32 +01:00
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
print("\nChosen Module to run: " + chosen_module)
|
2019-12-14 04:11:32 +01:00
|
|
|
|
2019-12-15 06:31:18 +01:00
|
|
|
Runner().run(modules[chosen_module])
|
2019-12-14 04:11:32 +01:00
|
|
|
|