server/sources/__init__.py
changeset 8892 80783605d270
parent 8696 0bb18407c053
child 9180 13ed6de41774
--- a/server/sources/__init__.py	Mon Apr 08 17:33:49 2013 +0200
+++ b/server/sources/__init__.py	Mon Apr 22 14:54:22 2013 +0200
@@ -140,17 +140,20 @@
         return '<%s %s source %s @%#x>' % (self.uri, self.__class__.__name__,
                                            self.eid, id(self))
 
-    def __cmp__(self, other):
+    def __lt__(self, other):
         """simple comparison function to get predictable source order, with the
         system source at last
         """
         if self.uri == other.uri:
-            return 0
+            return False
         if self.uri == 'system':
-            return 1
+            return False
         if other.uri == 'system':
-            return -1
-        return cmp(self.uri, other.uri)
+            return True
+        return self.uri < other.uri
+
+    def __eq__(self, other):
+        return self.uri == other.uri
 
     def backup(self, backupfile, confirm, format='native'):
         """method called to create a backup of source's data"""