Implement hello world dbus and assynchronous enforcing.
This commit is contained in:
10
config.py
10
config.py
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user