Skip to content

Commit

Permalink
Logic to overwrite the queue_directory if the configuration file cont…
Browse files Browse the repository at this point in the history
…ains a queue_directory in the parser section
  • Loading branch information
benne238 committed Jul 14, 2021
1 parent 3ec46b8 commit 7dc383b
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 @@ -2,10 +2,15 @@
from .config import config
import configparser, sys
from pathlib import Path as path
import webqueue2api.parser

config_parser_object = configparser.ConfigParser()
config_file_location = path.joinpath(path(sys.executable).parent.parent.parent, "webqueue2api_config")

if path(config_file_location).exists():
config_parser_object.read(config_file_location)

if config_parser_object.has_section("parser"):
if config_parser_object.has_option("parser", "queue_directory"):
webqueue2api.parser.config.queue_directory = config_parser_object["parser"]["queue_directory"]

0 comments on commit 7dc383b

Please sign in to comment.