From e8115fc9063356a808211891eeebd41f248c8346 Mon Sep 17 00:00:00 2001 From: benne238 Date: Wed, 14 Jul 2021 13:50:43 -0400 Subject: [PATCH] Added logic to overwrite the environment variable if it exists in the config file under the api section --- src/webqueue2api/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/webqueue2api/__init__.py b/src/webqueue2api/__init__.py index fcf09eb..ed9c1ff 100644 --- a/src/webqueue2api/__init__.py +++ b/src/webqueue2api/__init__.py @@ -3,6 +3,7 @@ import configparser, sys from pathlib import Path as path import webqueue2api.parser +import webqueue2api.api config_parser_object = configparser.ConfigParser() config_file_location = path.joinpath(path(sys.executable).parent.parent.parent, "webqueue2api_config") @@ -15,3 +16,7 @@ webqueue2api.parser.config.queue_directory = config_parser_object["parser"]["queue_directory"] if config_parser_object.has_option("parser", "queues_to_ignore"): webqueue2api.parser.config.queues_to_ignore = config_parser_object["parser"]["queues_to_ignore"] + +if config_parser_object.has_section("api"): + if config_parser_object.has_option("api", "environment"): + webqueue2api.api.config.environment = config_parser_object["api"]["environment"] \ No newline at end of file