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>
bzr-import-20160707
Julien Cristau 10 years ago committed by Niels Thykier
parent d75813eb07
commit ba981aabc2

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