Skip to content

Commit

Permalink
Added basic logic to check if the webqueue2api_config file exists in …
Browse files Browse the repository at this point in the history
…the root of the webqueue2api package directory and read the configurations from that file if so
  • Loading branch information
benne238 committed Jul 14, 2021
1 parent a59ea8b commit 3ec46b8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/webqueue2api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
from webqueue2api.parser import Item, Queue, load_queues
from .config import config
from .config import config
import configparser, sys
from pathlib import Path as path

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)

0 comments on commit 3ec46b8

Please sign in to comment.