RcGcDb/src/config.py
2024-08-09 14:00:31 +02:00

10 lines
451 B
Python

import json, sys, logging
try: # load settings
with open("settings.json", encoding="utf8") as sfile:
settings = json.load(sfile)
if "user-agent" in settings["header"]:
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="2.0 Beta") # set the version in the useragent
except FileNotFoundError:
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
sys.exit(1)