Prefer human readable output in qvm-prefs and qubes-prefs tools

This commit is contained in:
Marek Marczykowski-Górecki 2016-02-11 02:52:06 +01:00 committed by Wojtek Porczyk
parent 68ed50c97d
commit 5375dce90d
4 changed files with 9 additions and 4 deletions

View File

@ -335,6 +335,8 @@ class Label(object):
element.text = self.name
return element
def __str__(self):
return self.name
def __repr__(self):
return '{}({!r}, {!r}, {!r})'.format(

View File

@ -72,10 +72,10 @@ def main(args=None):
continue
if args.app.property_is_default(prop):
print('{name:{width}s} D {value!r}'.format(
print('{name:{width}s} D {value!s}'.format(
name=prop.__name__, width=width, value=value))
else:
print('{name:{width}s} - {value!r}'.format(
print('{name:{width}s} - {value!s}'.format(
name=prop.__name__, width=width, value=value))
return 0

View File

@ -75,10 +75,10 @@ def main(args=None):
continue
if args.vm.property_is_default(prop):
print('{name:{width}s} D {value!r}'.format(
print('{name:{width}s} D {value!s}'.format(
name=prop.__name__, width=width, value=value))
else:
print('{name:{width}s} - {value!r}'.format(
print('{name:{width}s} - {value!s}'.format(
name=prop.__name__, width=width, value=value))
return 0

View File

@ -290,6 +290,9 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
# properties not loaded from XML, calculated at run-time
#
def __str__(self):
return self.name
# VMM-related
@qubes.tools.qvm_ls.column(width=3)