update for MMGen v13.3.dev6
This commit is contained in:
parent
f9ba7b89c8
commit
cb93e52755
15 changed files with 36 additions and 37 deletions
|
|
@ -33,19 +33,6 @@ def get_day_hms(t=None,utc=False):
|
|||
ret = (time.localtime,time.gmtime)[utc](secs)
|
||||
return '{:04}-{:02}-{:02} {:02}:{:02}:{:02}'.format(*ret[0:6])
|
||||
|
||||
def format_elapsed_hr(t,now=None,cached={}):
|
||||
now = now or time.time()
|
||||
e = int(now - t)
|
||||
if not e in cached:
|
||||
h = abs(e) // 3600
|
||||
m = abs(e) // 60 % 60
|
||||
cached[e] = '{a}{b} minute{c} {d}'.format(
|
||||
a = '{} hour{}, '.format(h,suf(h)) if h else '',
|
||||
b = m,
|
||||
c = suf(m),
|
||||
d = 'ago' if e > 0 else 'in the future' ) if (h or m) else 'just now'
|
||||
return cached[e]
|
||||
|
||||
def do_system(cmd,testing=False,shell=False):
|
||||
if testing:
|
||||
from mmgen.util import msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue