-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
36 lines (27 loc) · 849 Bytes
/
app.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
25
26
27
28
29
30
31
32
33
34
35
36
import importlib
import loguru
import runtimeConfig
import configReader
from utils import _logging
from loguru import logger
CONFIG_NAME = "config.json"
configReader.read_config(CONFIG_NAME)
@loguru.logger.catch(Exception)
def main():
_logging.init_logging()
logger.info("⌂ Skyhouse Backend v1.1")
runtimeConfig.loaded_cogs = {}
for cog_path in runtimeConfig.initial_cogs:
logger.info(f"loading {cog_path}")
try:
cog = importlib.import_module(cog_path)
# noinspection PyUnresolvedReferences
cog.setup()
runtimeConfig.loaded_cogs[cog_path] = cog
logger.info(f"successfully loaded {cog_path}")
except: # noqa E721
logger.exception(f"Error loading {cog_path}")
while True:
pass
if __name__ == '__main__':
main()