Package: dak
Severity: minor
Tags: patch

showing '3 months' etc is just weird and inaccurate, I prefer just
displaying [X days, ] Y hours. Sufficiently precise, and more
consistent.

--- /org/ftp.debian.org/katie/helena    Tue Mar 15 03:20:57 2005
+++ helena      Thu Mar 31 16:29:01 2005
@@ -69,7 +69,7 @@
 
################################################################################
 
 def plural(x):
-    if x > 1:
+    if x != 1:
         return "s";
     else:
         return "";
@@ -77,28 +77,11 @@
 
################################################################################
 
 def time_pp(x):
-    if x < 60:
-        unit="second";
-    elif x < 3600:
-        x /= 60;
-        unit="minute";
-    elif x < 86400:
-        x /= 3600;
-        unit="hour";
-    elif x < 604800:
-        x /= 86400;
-        unit="day";
-    elif x < 2419200:
-        x /= 604800;
-        unit="week";
-    elif x < 29030400:
-        x /= 2419200;
-        unit="month";
-    else:
-        x /= 29030400;
-        unit="year";
-    x = int(x);
-    return "%s %s%s" % (x, unit, plural(x));
+    ret = ""
+    x = int(x/3600)
+    if x > 24: ret += "%s day%s, " % (int(x/24), plural(int(x/24)))
+    ret += "%s hour%s" % (x%24, plural(x%24))
+    return ret
 
 
################################################################################

--Jeroen

-- 
Jeroen van Wolffelaar
[EMAIL PROTECTED]
http://jeroen.A-Eskwadraat.nl


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to