Let's handle non-IrcCallbacks for sorting.

This commit is contained in:
Jeremy Fincher 2004-09-10 07:10:35 +00:00
parent 8edb880af0
commit 76056e35e4

View File

@ -88,10 +88,13 @@ class IrcCallback(IrcCommandDispatcher):
'name': lambda self: self.__class__.__name__,} 'name': lambda self: self.__class__.__name__,}
def __cmp__(self, other): def __cmp__(self, other):
if isinstance(other, IrcCallback):
ret = cmp(self.priority, other.priority) ret = cmp(self.priority, other.priority)
if not ret: if ret == 0:
ret = cmp(self.name(), other.name()) ret = cmp(self.name(), other.name())
return ret return ret
else:
return super(IrcCallback, self).__cmp__(other)
def name(self): def name(self):
"""Returns the name of the callback.""" """Returns the name of the callback."""