fix(worker): restore pure logic module verwaltung.py and its tests (SoC)
Ampel / ampel (push) Failing after 39s
Ampel / ampel (push) Failing after 39s
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import verwaltung
|
||||
import os
|
||||
import subprocess
|
||||
import threading
|
||||
@@ -140,7 +141,7 @@ def worker_stoppen():
|
||||
|
||||
|
||||
# API Polling
|
||||
def hole(pfad: str, host: str = None, timeout: int = 5):
|
||||
def old_hole(pfad: str, host: str = None, timeout: int = 5):
|
||||
ziel = host if host is not None else RIPPY_HOST
|
||||
if not ziel:
|
||||
return None
|
||||
@@ -152,8 +153,8 @@ def hole(pfad: str, host: str = None, timeout: int = 5):
|
||||
|
||||
|
||||
def hole_job_und_zustand():
|
||||
caps = hole("/capabilities")
|
||||
jobs = hole("/jobs") or []
|
||||
caps = verwaltung.hole("/capabilities")
|
||||
jobs = verwaltung.hole("/jobs") or []
|
||||
|
||||
online = False
|
||||
w_info = {}
|
||||
@@ -310,7 +311,7 @@ def main(page: ft.Page):
|
||||
c_danger = "#f43f5e" # Rose
|
||||
|
||||
# Formatter for job status
|
||||
def job_text(job: dict) -> str:
|
||||
def old_job_text(job: dict) -> str:
|
||||
titel = (job.get("title") or (job.get("id") or "")[:8]) or "?"
|
||||
status = {
|
||||
"transcoding": "komprimiert",
|
||||
@@ -641,7 +642,7 @@ def main(page: ft.Page):
|
||||
)
|
||||
row_items.append(
|
||||
ft.Text(
|
||||
job_text(j),
|
||||
verwaltung.job_text(j).split(",")[0].split(",")[0],
|
||||
color=c_muted,
|
||||
font_family="Consolas",
|
||||
size=13,
|
||||
|
||||
Reference in New Issue
Block a user