-
Notifications
You must be signed in to change notification settings - Fork 5
/
module-debugger.py
24 lines (18 loc) · 1.05 KB
/
module-debugger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from database.connection import Connection
from utilities.configuration_loader import ConfigurationLoader
from utilities.path import Path
from modules.runner import run
import pickle
configurations = ConfigurationLoader.load_by_config_folder(None, False)
for configuration in configurations:
with Connection(configuration) as connection:
if connection.has_orm():
connection.orm.tables.create_tables()
if connection.has_mongodb():
connection.mongodb.migrations()
with open(Path.var_folder_path() + '/' + configuration.hash + '.pickle', 'wb') as handle:
pickle.dump(configuration, handle, protocol=pickle.HIGHEST_PROTOCOL)
for configuration_key, aggregationModule in configuration.aggregations.config.items():
run(configuration.hash, configuration_key, aggregationModule.module, 'modules.aggregation.custom')
for configuration_key, operationModule in configuration.operations.config.items():
run(configuration.hash, configuration_key, operationModule.module, 'modules.operation.custom')