From 43651b81fd3169df4feaeca34dd79b3ffdd2c8ab Mon Sep 17 00:00:00 2001 From: Shayaan Shaikh Date: Tue, 10 Oct 2023 21:28:41 +0530 Subject: [PATCH] #135 if test server arg is used so it will use a different conf file is used --- fishy/helper/config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fishy/helper/config.py b/fishy/helper/config.py index 7f94f33..cd6f718 100644 --- a/fishy/helper/config.py +++ b/fishy/helper/config.py @@ -7,6 +7,8 @@ import logging import os # path to save the configuration file from typing import Optional +import sys + from event_scheduler import EventScheduler @@ -14,12 +16,18 @@ from fishy.osservices.os_services import os_services def filename(): - name = "fishy_config.json" + + if "--test-server" in sys.argv: + name = "fishy_config_test.json" + else: + name = "fishy_config.json" + _filename = os.path.join(os.environ["HOMEDRIVE"], os.environ["HOMEPATH"], "Documents", name) + if os.path.exists(_filename): return _filename - # fallback for onedrive documents + # fallback for OneDrive documents return os.path.join(os_services.get_documents_path(), name)