Implement hello world dbus and assynchronous enforcing.

This commit is contained in:
2022-06-22 20:21:22 -04:00
parent 0eed43c915
commit e48e01b07a
2 changed files with 48 additions and 19 deletions

View File

@@ -11,15 +11,12 @@ class Block(BaseModel):
keywords: List[str]
def load(filename: str) -> List[Block]:
result = [Block(path=filename, **block) for block in block_list]
return result
class Config(BaseModel):
blackblocks: List[Block]
whiteblocks: List[Block]
check_delay: int = 1
log_file: Path = Path()
config_file: Path = Path()
check_delay: int = 1000
minimize_delay: int = 5
blackblocks_only: bool = True
@@ -32,5 +29,6 @@ class Config(BaseModel):
with open(config_file, "r") as f:
config_dict = yaml.safe_load(f)
config = cls(**config_dict)
config.config_file = Path(config_file)
return config