2019-12-14 04:11:32 +01:00
|
|
|
import importlib
|
|
|
|
import os
|
2020-01-18 05:39:23 +01:00
|
|
|
import fire
|
2019-12-14 04:11:32 +01:00
|
|
|
|
|
|
|
|
2019-12-16 22:51:40 +01:00
|
|
|
def load_modules():
|
|
|
|
print("Loading modules")
|
2020-01-05 17:56:53 +01:00
|
|
|
loaded_modules = {}
|
2019-12-16 22:51:40 +01:00
|
|
|
for folder in os.listdir("./modules"):
|
|
|
|
try:
|
|
|
|
curr_module = importlib.import_module('.' + folder, package="modules")
|
2020-01-05 17:56:53 +01:00
|
|
|
loaded_modules[folder] = curr_module.get_module()
|
2019-12-16 22:51:40 +01:00
|
|
|
except AttributeError:
|
|
|
|
pass
|
|
|
|
print("Modules loaded successfully.\n")
|
2020-01-05 17:56:53 +01:00
|
|
|
return loaded_modules
|
2019-12-14 04:11:32 +01:00
|
|
|
|
|
|
|
|
2019-12-16 22:51:40 +01:00
|
|
|
modules = load_modules()
|
2020-01-18 05:39:23 +01:00
|
|
|
fire.Fire(modules)
|