forked from infra/ansible
updates+uptimes: have secs2dur always show the long duration.
Signed-off-by: James Antill <james@and.org>
This commit is contained in:
parent
0ae9436498
commit
e3fb6a82a0
1 changed files with 5 additions and 3 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue