CLI: Use API functions

This commit is contained in:
Qubasa
2023-10-02 15:36:02 +02:00
parent 29efda9608
commit 6640c78089
12 changed files with 259 additions and 149 deletions

View File

@@ -33,7 +33,16 @@ class BaseTask(threading.Thread):
self.finished: bool = False
def run(self) -> None:
self.finished = True
try:
self.task_run()
except Exception as e:
self.failed = True
self.log.exception(e)
finally:
self.finished = True
def task_run(self) -> None:
raise NotImplementedError
def run_cmd(self, cmd: list[str]) -> CmdState:
cwd = os.getcwd()