changeset 1614:5b5e7190452f

Fix various registry Entry `__lt__` methods. This resolves issue #221.
author Cheer Xiao <xiaqqaix@gmail.com>
date Wed, 01 Aug 2012 00:21:41 +0800
parents bc8a2546468b
children e872cb536c26
files MoinMoin/converter/__init__.py MoinMoin/items/__init__.py MoinMoin/items/content.py
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/__init__.py	Wed Aug 01 00:21:03 2012 +0800
+++ b/MoinMoin/converter/__init__.py	Wed Aug 01 00:21:41 2012 +0800
@@ -34,8 +34,8 @@
 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
-                if self.priority < other.priority:
-                    return True
+                if self.priority != other.priority:
+                    return self.priority < other.priority
                 if self.type_output != other.type_output:
                     return other.type_output.issupertype(self.type_output)
                 if self.type_input != other.type_input:
--- a/MoinMoin/items/__init__.py	Wed Aug 01 00:21:03 2012 +0800
+++ b/MoinMoin/items/__init__.py	Wed Aug 01 00:21:41 2012 +0800
@@ -77,9 +77,9 @@
 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
-                if self.priority < other.priority:
-                    return True
-                return self.itemtype == other.itemtype
+                if self.priority != other.priority:
+                    return self.priority < other.priority
+                return self.itemtype < other.itemtype
             return NotImplemented
 
 
--- a/MoinMoin/items/content.py	Wed Aug 01 00:21:03 2012 +0800
+++ b/MoinMoin/items/content.py	Wed Aug 01 00:21:41 2012 +0800
@@ -83,8 +83,8 @@
 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
-                if self.priority < other.priority:
-                    return True
+                if self.priority != other.priority:
+                    return self.priority < other.priority
                 if self.content_type != other.content_type:
                     return other.content_type.issupertype(self.content_type)
                 return False