Make QubesVM objects comparable and str()-able

Required for sorting and displaying easily.
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-12 00:42:50 +01:00
parent 310d9da381
commit 9262363569
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -46,6 +46,14 @@ class QubesVM(qubesmgmt.base.PropertyHolder):
self._volumes = None
self.app.domains.clear_cache()
def __str__(self):
return self._method_dest
def __lt__(self, other):
if isinstance(other, QubesVM):
return self.name < other.name
return NotImplemented
def start(self):
'''
Start domain.