fix a bug in ged that prevent callback to be called in the correct order.

This commit is contained in:
Yann Leboulanger 2010-09-17 12:41:00 +02:00
parent 409038784a
commit c9bc9393d5
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ class GlobalEventsDispatcher(object):
for i, h in enumerate(handlers_list): for i, h in enumerate(handlers_list):
if priority < h[0]: if priority < h[0]:
break break
else:
# no event with smaller prio found, put it at the end
i += 1
handlers_list.insert(i, (priority, handler)) handlers_list.insert(i, (priority, handler))
else: else: