Commit 33594170 authored by Julien Muchembled's avatar Julien Muchembled

ActivityTool: use sort(key=...) instead of sort(cmp=...)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28403 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 573767dd
......@@ -942,12 +942,9 @@ class ActivityTool (Folder, UniqueObject):
try:
#Sort activity list by priority
activity_list = activity_dict.values()
# Sort method must be local to access "self"
def cmpActivities(activity_1, activity_2):
return cmp(activity_1.getPriority(self), activity_2.getPriority(self))
activity_list.sort(cmpActivities)
activity_list = sorted(activity_dict.itervalues(),
key=lambda activity: activity.getPriority(self))
# Wakeup each queue
for activity in activity_list:
activity.wakeup(inner_self, processing_node)
......
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