small updates

This commit is contained in:
2024-12-06 16:41:59 +01:00
parent 9623cfcf2c
commit 43a52391d5
2 changed files with 11 additions and 2 deletions
+9 -1
View File
@@ -1,3 +1,4 @@
import logging
from pathlib import Path
from lxml import etree
from functools import cached_property
@@ -24,7 +25,14 @@ class Config:
@cached_property
def loglevel(self) -> str:
return self.app_root.xpath('logLevel').pop().text
value = self.app_root.xpath('logLevel').pop().text.upper()
_loglevels = ", ".join(logging.getLevelNamesMapping().keys())
if value not in logging.getLevelNamesMapping().keys():
raise ValueError(
"logLevel can only contain one of these values: "
f"{_loglevels}"
)
return value
@cached_property
def testmode(self) -> bool: