#135 if test server arg is used so it will use a different conf file is used

This commit is contained in:
Shayaan Shaikh 2023-10-10 21:28:41 +05:30
parent c67a40a7d6
commit 43651b81fd

View File

@ -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)