Commit fe4990a3 authored by Hanno Schlichting's avatar Hanno Schlichting

Simplify the sort code

parent 93a7551b
......@@ -16,6 +16,7 @@ $Id$
"""
import logging
import operator
import sys
import string
import time
......@@ -1008,7 +1009,7 @@ class ZCatalog(Folder, Persistent, Implicit):
def delColumn(self, name):
return self._catalog.delColumn(name)
#
# Catalog report methods
#
......@@ -1017,11 +1018,7 @@ class ZCatalog(Folder, Persistent, Implicit):
def getCatalogReport(self):
""" Reports about the duration of queries """
rval = self._catalog.getCatalogReport().report()
sort_by = 'duration'
rval.sort(lambda e1, e2, sort_by=sort_by:
cmp(e1[sort_by], e2[sort_by]))
rval.reverse()
rval.sort(key=operator.itemgetter('duration'), reverse=True)
return rval
security.declareProtected(manage_zcatalog_entries,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment