Add sort method to MigrationItem

write_excuses wants them sorted, and python3 doesn't allow sorting
arbitrary objects.

Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Julien Cristau 2015-04-26 18:20:09 +02:00 committed by Niels Thykier
parent d75813eb07
commit ba981aabc2

View File

@ -54,6 +54,9 @@ class MigrationItem(object):
def __hash__(self):
return hash((self.uvname, self.version))
def __lt__(self, other):
return (self.uvname, self.version) < (other.uvname, other.version)
@property
def name(self):
return self._name