comparison src/tools/misc.py @ 876:65bf1bc70f6b

tools, plugin XEP-0077: small fixes
author souliane <souliane@mailoo.org>
date Tue, 25 Feb 2014 22:58:42 +0100
parents 1fe00f0c9a91
children 301b342c697a
comparison
equal deleted inserted replaced
875:19d7d077478a 876:65bf1bc70f6b
52 first 52 first
53 """ 53 """
54 if point_name not in self.__triggers: 54 if point_name not in self.__triggers:
55 self.__triggers[point_name] = [] 55 self.__triggers[point_name] = []
56 if priority != 0 and priority in [trigger_tuple[0] for trigger_tuple in self.__triggers[point_name]]: 56 if priority != 0 and priority in [trigger_tuple[0] for trigger_tuple in self.__triggers[point_name]]:
57 if priority in (MIN_PRIORITY, MAX_PRIORITY): 57 if priority in (self.MIN_PRIORITY, self.MAX_PRIORITY):
58 warning(_("There is already a bound priority [%s]") % point_name) 58 warning(_("There is already a bound priority [%s]") % point_name)
59 else: 59 else:
60 debug(_("There is already a trigger with the same priority [%s]") % point_name) 60 debug(_("There is already a trigger with the same priority [%s]") % point_name)
61 self.__triggers[point_name].append((priority, callback)) 61 self.__triggers[point_name].append((priority, callback))
62 self.__triggers[point_name].sort(key=lambda trigger_tuple: 62 self.__triggers[point_name].sort(key=lambda trigger_tuple: