From 0b6dafec62f22383bf501e1594d3b9a8c93f2337 Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 3 Nov 2024 21:29:10 -0600 Subject: Fix link redirects and remove BASE_URL --- config.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'config.py') diff --git a/config.py b/config.py index 9c56add..bb878bf 100644 --- a/config.py +++ b/config.py @@ -1,7 +1,6 @@ import jsonschema import os import yaml -import validators import sys import logging from colorlog import ColoredFormatter @@ -23,7 +22,6 @@ LOG = logging.getLogger("pythonConfig") LOG.setLevel(log_level) LOG.addHandler(stream) -BASE_URL = None IP_TO_LOCATION = None API_KEY = None @@ -33,11 +31,10 @@ schema = { "config": { "type": "object", "properties": { - "base_url": {"type": "string"}, "ip_to_location": {"type": "boolean"}, "api_key": {"type": "string"}, }, - "required": ["base_url", "ip_to_location"], + "required": ["ip_to_location"], } }, "required": ["config"], @@ -61,7 +58,6 @@ def load_config(): with open(file_path, "w") as f: f.write( """ - base_url: "" ip_to_location: "" api_key: "" """ @@ -75,7 +71,7 @@ def load_config(): # Validate the options within config.yaml def validate_config(file_contents): - global BASE_URL, IP_TO_LOCATION, API_KEY + global IP_TO_LOCATION, API_KEY config = yaml.safe_load(file_contents) try: @@ -84,12 +80,6 @@ def validate_config(file_contents): LOG.error(e.message) sys.exit() - # Validate BASE_URL - if not validators.url(config["config"]["base_url"]): - LOG.error("BASE_URL is not a valid URL") - else: - BASE_URL = config["config"]["base_url"] - # Make IP_TO_LOCATION a boolean IP_TO_LOCATION = bool(config["config"]["ip_to_location"]) -- cgit v1.2.3-70-g09d2