mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Let's handle non-IrcCallbacks for sorting.
This commit is contained in:
parent
8edb880af0
commit
76056e35e4
@ -88,10 +88,13 @@ class IrcCallback(IrcCommandDispatcher):
|
||||
'name': lambda self: self.__class__.__name__,}
|
||||
|
||||
def __cmp__(self, other):
|
||||
if isinstance(other, IrcCallback):
|
||||
ret = cmp(self.priority, other.priority)
|
||||
if not ret:
|
||||
if ret == 0:
|
||||
ret = cmp(self.name(), other.name())
|
||||
return ret
|
||||
else:
|
||||
return super(IrcCallback, self).__cmp__(other)
|
||||
|
||||
def name(self):
|
||||
"""Returns the name of the callback."""
|
||||
|
Loading…
Reference in New Issue
Block a user