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-25 16:44:55 +02:00 committed by Niels Thykier
parent 36d3b96158
commit f83029c55e

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