Change sort in datedetector to use key based comparison

pull/128/merge^2
Steven Hiscocks 12 years ago
parent 99c92a56ca
commit 2ecf34540e

@ -204,7 +204,7 @@ class DateDetector:
self.__lock.acquire() self.__lock.acquire()
try: try:
logSys.debug("Sorting the template list") logSys.debug("Sorting the template list")
self.__templates.sort(lambda x, y: cmp(x.getHits(), y.getHits()), reverse=True) self.__templates.sort(key=lambda x: x.getHits(), reverse=True)
t = self.__templates[0] t = self.__templates[0]
logSys.debug("Winning template: %s with %d hits" % (t.getName(), t.getHits())) logSys.debug("Winning template: %s with %d hits" % (t.getName(), t.getHits()))
finally: finally:

Loading…
Cancel
Save