From 71eefbea1436b24ec18750740f099b7a27dc78c0 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Tue, 19 Sep 2017 17:02:19 +0200 Subject: [PATCH] qubes/vm: put name= first in __repr__ This is to have it in case the repr is truncated. --- qubes/vm/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py index 16193729..fe2e1288 100644 --- a/qubes/vm/__init__.py +++ b/qubes/vm/__init__.py @@ -384,14 +384,16 @@ class BaseVM(qubes.PropertyHolder): def __repr__(self): proprepr = [] for prop in self.property_list(): + if prop.__name__ in ('name', 'qid'): + continue try: proprepr.append('{}={!s}'.format( prop.__name__, getattr(self, prop.__name__))) except AttributeError: continue - return '<{} object at {:#x} {}>'.format( - self.__class__.__name__, id(self), ' '.join(proprepr)) + return '<{} at {:#x} name={!r} qid={!r} {}>'.format(type(self).__name__, + id(self), self.name, self.qid, ' '.join(proprepr)) # # xml serialising methods