From 62c02bab9a0d35c244414de3a6e9423470ba110e Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Sun, 24 Jan 2021 13:42:48 +0100 Subject: [PATCH] moved configs to config folder --- .gitignore | 6 ++---- .../pageSettings-example.json | 0 settings-example.json => config/settings-example.json | 0 src/DashboardLeaf.py | 6 ++++-- src/logic/Constants.py | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) rename pageSettings-example.json => config/pageSettings-example.json (100%) rename settings-example.json => config/settings-example.json (100%) diff --git a/.gitignore b/.gitignore index b2bdb7e..08b45e7 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 bad4c1f..596799d 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 621984c..3d8e8e8 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) -- GitLab