report support, readme

This commit is contained in:
2021-03-07 00:04:25 +03:00
parent c45662517b
commit 088698d8e1
19 changed files with 346 additions and 46 deletions

View File

@ -20,7 +20,9 @@
import subprocess
from logging import Logger
from typing import Optional
from typing import List, Optional
from ahriman.core.configuration import Configuration
def check_output(*args: str, exception: Optional[Exception],
@ -36,4 +38,11 @@ def check_output(*args: str, exception: Optional[Exception],
for line in e.output.decode('utf8').splitlines():
logger.debug(line)
raise exception or e
return result
return result
def options_list(config: Configuration, section: str, key: str) -> List[str]:
raw = config.get(section, key, fallback=None)
if not raw: # empty string or none
return []
return raw.split()