mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +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__,}
|
'name': lambda self: self.__class__.__name__,}
|
||||||
|
|
||||||
def __cmp__(self, other):
|
def __cmp__(self, other):
|
||||||
ret = cmp(self.priority, other.priority)
|
if isinstance(other, IrcCallback):
|
||||||
if not ret:
|
ret = cmp(self.priority, other.priority)
|
||||||
ret = cmp(self.name(), other.name())
|
if ret == 0:
|
||||||
return ret
|
ret = cmp(self.name(), other.name())
|
||||||
|
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."""
|
||||||
|
Loading…
Reference in New Issue
Block a user