diff --git a/.gitignore b/.gitignore index b2bdb7eecfcb6bdbde6b345dec34c9f24ced602c..08b45e7f62cad23f768c93d617405aed195eed95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ /Pipfile.lock -/settings.json -/pageSettings.json -/pageSettings_backup.json -/boardGames.json +/config/settings.json +/config .idea/ /*.ics diff --git a/pageSettings-example.json b/config/pageSettings-example.json similarity index 100% rename from pageSettings-example.json rename to config/pageSettings-example.json diff --git a/settings-example.json b/config/settings-example.json similarity index 100% rename from settings-example.json rename to config/settings-example.json diff --git a/src/DashboardLeaf.py b/src/DashboardLeaf.py index bad4c1fca805e51006108249b99f958a621a6bef..596799d26f7eb5a7672bd1790a491edc7edaca07 100644 --- a/src/DashboardLeaf.py +++ b/src/DashboardLeaf.py @@ -7,6 +7,7 @@ from flask_socketio import SocketIO from blueprints import Routes from logic import Constants +from logic.Constants import CONFIG_DIR from logic.page.PageManager import PageManager from logic.service.ServiceRegistry import ServiceRegistry from logic.tile.TileScheduler import TileScheduler @@ -16,7 +17,8 @@ LOGGER = DefaultLogger().create_logger_if_not_exists(Constants.APP_NAME) class DashboardLeaf(FlaskBaseApp): def __init__(self, appName: str): - super().__init__(appName, os.path.dirname(__file__), LOGGER, serveRobotsTxt=True) + super().__init__(appName, os.path.dirname(__file__), LOGGER, serveRobotsTxt=True, + settingsPath=os.path.join(CONFIG_DIR, 'settings.json')) self._tileService = None self._pageManager = None ServiceRegistry.get_instance() @@ -35,7 +37,7 @@ class DashboardLeaf(FlaskBaseApp): self._tileScheduler.emit_from_cache() self._tileScheduler = TileScheduler(socketio) - self._pageManager = PageManager(Constants.ROOT_DIR, self._tileScheduler, app) + self._pageManager = PageManager(Constants.CONFIG_DIR, self._tileScheduler, app) self._tileScheduler.run() return app diff --git a/src/logic/Constants.py b/src/logic/Constants.py index 621984ccb79d6f8348bc9e5c0cb919593adec7a7..3d8e8e87e3273784d6b61b4bbac34e4b2c65f75f 100644 --- a/src/logic/Constants.py +++ b/src/logic/Constants.py @@ -4,6 +4,8 @@ from TheCodeLabs_BaseUtils.Color import Color APP_NAME = 'DashboardLeaf' ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) +CONFIG_DIR = os.path.join(ROOT_DIR, 'config') + # colors RED = Color(230, 76, 60)