small updates
This commit is contained in:
+2
-1
@@ -1,9 +1,10 @@
|
||||
import argparse
|
||||
from argparse import Namespace
|
||||
from functools import cached_property
|
||||
|
||||
class ArgumentsParser:
|
||||
@cached_property
|
||||
def parser(self):
|
||||
def parser(self) -> Namespace:
|
||||
parser = argparse.ArgumentParser(
|
||||
prog=__file__,
|
||||
description='Trigger based CPU governor auto adjust program.',
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user