Skip to content

Commit

Permalink
devices : make DeviceInfo sortable
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jun 5, 2017
1 parent b08574a commit 257c8c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qubes/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ def __eq__(self, other):
self.ident == other.ident
)

def __lt__(self, other):
if isinstance(other, DeviceInfo):
return (self.backend_domain, self.ident) < \
(other.backend_domain, other.ident)
return NotImplemented

def __str__(self):
return '{!s}:{!s}'.format(self.backend_domain, self.ident)

Expand Down

0 comments on commit 257c8c0

Please sign in to comment.