mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-12 01:11:29 +00:00
running-autopkgtests: use f-strings
This commit is contained in:
parent
a9eb902b83
commit
bce1ef88c5
@ -51,15 +51,14 @@ def get_running():
|
|||||||
env = jobinfo[0].get("env", "-")
|
env = jobinfo[0].get("env", "-")
|
||||||
time = str(datetime.timedelta(seconds=jobinfo[1]))
|
time = str(datetime.timedelta(seconds=jobinfo[1]))
|
||||||
try:
|
try:
|
||||||
fmt = "R {6:6} {0:30} {5:10} {1:8} {2:8} {3:31} {4} {7}"
|
line = f"R {time:6} {pkg:30} {'-':10} {series:8} {arch:8} {ppas:31} {triggers} {env}\n"
|
||||||
line = fmt.format(pkg, series, arch, ppas, triggers, "-", time, env)
|
|
||||||
running.append((jobinfo[1], line))
|
running.append((jobinfo[1], line))
|
||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
output = ""
|
output = ""
|
||||||
for time, row in sorted(running, reverse=True):
|
for time, row in sorted(running, reverse=True):
|
||||||
output += f"{row}\n"
|
output += f"{row}"
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
@ -86,9 +85,7 @@ def get_queued():
|
|||||||
|
|
||||||
n = n + 1
|
n = n + 1
|
||||||
try:
|
try:
|
||||||
fmt = "Q{5:04d} {7:>6} {0:30} {6:10} {1:8} {2:8} {3:31} {4}"
|
output += f"Q{n:04d} {'-:--':>6} {pkg:30} {origin:10} {series:8} {arch:8} {ppas:31} {triggers}\n"
|
||||||
line = fmt.format(pkg, series, arch, ppas, triggers, n, origin, "-:--")
|
|
||||||
output += f"{line}\n"
|
|
||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return output
|
return output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user