Index: roundup/backends/back_anydbm.py =================================================================== RCS file: /cvsroot/roundup/roundup/roundup/backends/back_anydbm.py,v retrieving revision 1.146.2.1 diff -c -r1.146.2.1 back_anydbm.py *** roundup/backends/back_anydbm.py 12 May 2004 22:28:21 -0000 1.146.2.1 --- roundup/backends/back_anydbm.py 16 May 2004 09:27:33 -0000 *************** *** 1800,1820 **** finally: cldb.close() if '-' in directions: # one or more of the sort specs is in reverse order, so we have # to use this icky function to sort def sortfun(a, b, directions=directions, n=range(len(directions))): for i in n: ! if a[i] == b[i]: continue if directions[i] == '+': return cmp(a[i],b[i]) else: return cmp(b[i],a[i]) # for consistency, sort by the id if the items are equal return cmp(a[-2], b[-2]) matches.sort(sortfun) else: ! # sorting is in the normal direction matches.sort() # pull the id out of the individual entries --- 1800,1826 ---- finally: cldb.close() + # sort vals are inserted, but directions are appended, so reverse + directions.reverse() + if '-' in directions: # one or more of the sort specs is in reverse order, so we have # to use this icky function to sort def sortfun(a, b, directions=directions, n=range(len(directions))): for i in n: ! if not cmp(a[i], b[i]): ! continue if directions[i] == '+': + # compare in the usual, ascending direction return cmp(a[i],b[i]) else: + # compare in the reverse, descending direction return cmp(b[i],a[i]) # for consistency, sort by the id if the items are equal return cmp(a[-2], b[-2]) matches.sort(sortfun) else: ! # sorting is in the normal, ascending direction matches.sort() # pull the id out of the individual entries