From e3fb6a82a0b16d8efbbcdacfa200b7dcb0631f9c Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 30 Oct 2025 11:06:35 -0400 Subject: [PATCH] updates+uptimes: have secs2dur always show the long duration. Signed-off-by: James Antill --- files/scripts/updates-uptime-cmd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/scripts/updates-uptime-cmd.py b/files/scripts/updates-uptime-cmd.py index c299236bb4..0ed845f19c 100755 --- a/files/scripts/updates-uptime-cmd.py +++ b/files/scripts/updates-uptime-cmd.py @@ -528,8 +528,10 @@ def format_duration(seconds, short=False, static=False): return "".join(reversed(ret)) # Duration in UI for lists/etc. -def _ui_dur(dur): - return format_duration(dur, short=conf_short_duration, static=True) +def _ui_dur(dur, short=None): + if short is None: + short = conf_short_duration + return format_duration(dur, short=short, static=True) def _main_file_recent(): f1 = os.stat(fname) @@ -1912,7 +1914,7 @@ def _main(): cmd = subparsers.add_parser("secs2dur", help=argparse.SUPPRESS) cmd.add_argument("secs", type=int, help="seconds") - __defs(func=lambda x: print("dur:", _ui_dur(x.secs))) + __defs(func=lambda x: print("dur:", _ui_dur(x.secs, short=False))) cmd = subparsers.add_parser("int2num", help=argparse.SUPPRESS) cmd.add_argument("num", type=int, help="int")