mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-19 19:46:38 +08:00
updates+uptimes: have secs2dur always show the long duration.
Signed-off-by: James Antill <james@and.org>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user