From df4e619b4f9acc781214daab476e6432c71135d9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 20 Jun 2008 15:46:13 +0200 Subject: [PATCH] playtime with hours always enabled --- oxutils/format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oxutils/format.py b/oxutils/format.py index 11b1ec9..b4c3e9b 100644 --- a/oxutils/format.py +++ b/oxutils/format.py @@ -175,7 +175,7 @@ def ms2runtime(ms, shortenLong=False): runtimeString = filter(lambda x: not x.startswith('0'), runtimeString) return " ".join(runtimeString).strip() -def ms2playtime(ms): +def ms2playtime(ms, hours=False): ''' >>> ms2playtime(5000) '00:05' @@ -193,7 +193,7 @@ def ms2playtime(ms): dd = int(hh / 24) hh = hh % 24 playtime= "%d:%02d:%02d:%02d" % (dd, hh, mm, ss) - if hh: + if hh or hours: playtime= "%02d:%02d:%02d" % (hh, mm, ss) else: playtime= "%02d:%02d" % (mm, ss)