fixed + completed type hints

This commit is contained in:
2024-04-12 23:33:09 +02:00
parent 30339f0ece
commit cce7e96779
8 changed files with 77 additions and 53 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
import json
import re
@@ -29,8 +31,9 @@ class Config:
def __init__(self, path: str = "config.json") -> None:
self.load(path)
def load(self, path: str) -> None:
@staticmethod
def load(path: str) -> None:
with open(path, "r") as f:
config = json.load(f)
@@ -39,5 +42,6 @@ class Config:
if hasattr(Config, k):
setattr(Config, k, v)
@staticmethod
def formatKey(key: str) -> str:
return re.sub(r"([a-z])([A-Z])", r"\1_\2", key).upper()
return re.sub(r"([a-z])([A-Z])", r"\1_\2", key).upper()