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>
master
Julien Cristau 9 years ago committed by Niels Thykier
parent 36d3b96158
commit f83029c55e

@ -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

Loading…
Cancel
Save