gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/metacode pegboard.py


From: Asko Soukka
Subject: [Gzz-commits] gzz/metacode pegboard.py
Date: Thu, 07 Nov 2002 06:09:14 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/11/07 06:09:13

Modified files:
        metacode       : pegboard.py 

Log message:
        secondary ordering by :s

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/pegboard.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/metacode/pegboard.py
diff -u gzz/metacode/pegboard.py:1.13 gzz/metacode/pegboard.py:1.14
--- gzz/metacode/pegboard.py:1.13       Wed Nov  6 07:28:48 2002
+++ gzz/metacode/pegboard.py    Thu Nov  7 06:09:13 2002
@@ -77,19 +77,19 @@
 #compares pegs' status at first and if they are same
 #compares dates pegs are last updated
 def pegcmp(a, b):
-    if priority.has_key(a['status'].capitalize().split(' ')[0]) \
-           and priority.has_key(b['status'].capitalize().split(' ')[0]) \
-           and not a['status'] == b['status']:
-        return priority[a['status'].capitalize().split(' ')[0]] \
-               > priority[b['status'].capitalize().split(' ')[0]] or -1
-
+    if priority.has_key(a['status'].capitalize().split()[0]) \
+           and priority.has_key(b['status'].capitalize().split()[0]) \
+           and not a['status'].lower().split() == b['status'].lower().split():
+        return priority[a['status'].capitalize().split()[0]] \
+               > priority[b['status'].capitalize().split()[0]] or -1
+    
     as = a['date'].split('-')
     bs = b['date'].split('-')
     if not len(as) == 3 or not len(bs) == 3:
         return len(as) < len(bs) or (len(bs) < len(as)) * -1 or 0
     ac = int(as[0])*10000 + int(as[1])*100 + int(as[2])
     bc = int(bs[0])*10000 + int(bs[1])*100 + int(bs[2])
-    return ac < bc or (bc < ac) * -1 or 0
+    return ac < bc or (ac > bc) * -1 or 0
 
 #returns the value of the first occurrense or all of the occurrences
 #of given tagName in docutils' document tree




reply via email to

[Prev in Thread] Current Thread [Next in Thread]