added several new files

This commit is contained in:
2024-12-05 10:40:38 +01:00
parent 5d7dd05c99
commit 51b8647ded
10 changed files with 109 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from pathlib import Path
from lxml import etree
from functools import cached_property
from arguments import ArgumentsParser
class Config:
def __init__(self, basepath: Path) -> None:
self.basepath = basepath
self.config = ArgumentsParser().parser.config
@cached_property
def root(self) -> etree.ElementTree:
return etree.parse(self.basepath / self.config)
@cached_property
def app_root(self) -> etree.Element:
return self.root.xpath('/cpuGovernorAutoAdjust').pop()
@cached_property
def loglevel(self) -> str:
return self.app_root.xpath('logLevel').pop().text