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,11 +942,8 @@ class ActivityTool (Folder, UniqueObject): ...@@ -942,11 +942,8 @@ class ActivityTool (Folder, UniqueObject):
try: try:
#Sort activity list by priority #Sort activity list by priority
activity_list = activity_dict.values() activity_list = sorted(activity_dict.itervalues(),
# Sort method must be local to access "self" key=lambda activity: activity.getPriority(self))
def cmpActivities(activity_1, activity_2):
return cmp(activity_1.getPriority(self), activity_2.getPriority(self))
activity_list.sort(cmpActivities)
# Wakeup each queue # Wakeup each queue
for activity in activity_list: for activity in activity_list:
......
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