comparison roundup/hyperdb.py @ 7114:33eb82ad26ba

issue2551250: Fix sorting of detectors .. even if there are two with the same name and priority (can happen if they are created in two different files).
author Ralf Schlatterbeck <rsc@runtux.com>
date Wed, 21 Dec 2022 20:13:39 +0100
parents 9b4bd9bc9bdc
children 76a21cf791b9
comparison
equal deleted inserted replaced
7113:5c6dd791d638 7114:33eb82ad26ba
1181 1181
1182 # do the db-related init stuff 1182 # do the db-related init stuff
1183 db.addclass(self) 1183 db.addclass(self)
1184 1184
1185 actions = "create set retire restore".split() 1185 actions = "create set retire restore".split()
1186 self.auditors = dict([(a, PrioList()) for a in actions]) 1186 skey = lambda x: x[:2]
1187 self.reactors = dict([(a, PrioList()) for a in actions]) 1187 self.auditors = dict([(a, PrioList(key=skey)) for a in actions])
1188 self.reactors = dict([(a, PrioList(key=skey)) for a in actions])
1188 1189
1189 def __repr__(self): 1190 def __repr__(self):
1190 """Slightly more useful representation 1191 """Slightly more useful representation
1191 Note that an error message can be raised at a point 1192 Note that an error message can be raised at a point
1192 where self.classname isn't known yet if the error 1193 where self.classname isn't known yet if the error

Roundup Issue Tracker: http://roundup-tracker.org/