Skip to content

Commit

Permalink
Added logic to overwrite the environment variable if it exists in the…
Browse files Browse the repository at this point in the history
… config file under the api section
  • Loading branch information
benne238 committed Jul 14, 2021
1 parent b11d2a8 commit e8115fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/webqueue2api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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"]

0 comments on commit e8115fc

Please sign in to comment.