tools/qvm-prefs: adjust for qubesmgmt module
list_properties() returns strings, not property objects.
This commit is contained in:
parent
bf03f6630f
commit
e4c2294ce0
@ -77,22 +77,22 @@ def process_actions(parser, args, target):
|
|||||||
'''
|
'''
|
||||||
if args.property is None:
|
if args.property is None:
|
||||||
properties = target.property_list()
|
properties = target.property_list()
|
||||||
width = max(len(prop.__name__) for prop in properties)
|
width = max(len(prop) for prop in properties)
|
||||||
|
|
||||||
for prop in sorted(properties):
|
for prop in sorted(properties):
|
||||||
try:
|
try:
|
||||||
value = getattr(target, prop.__name__)
|
value = getattr(target, prop)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print('{name:{width}s} U'.format(
|
print('{name:{width}s} U'.format(
|
||||||
name=prop.__name__, width=width))
|
name=prop, width=width))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if target.property_is_default(prop):
|
if target.property_is_default(prop):
|
||||||
print('{name:{width}s} D {value!s}'.format(
|
print('{name:{width}s} D {value!s}'.format(
|
||||||
name=prop.__name__, width=width, value=value))
|
name=prop, width=width, value=value))
|
||||||
else:
|
else:
|
||||||
print('{name:{width}s} - {value!s}'.format(
|
print('{name:{width}s} - {value!s}'.format(
|
||||||
name=prop.__name__, width=width, value=value))
|
name=prop, width=width, value=value))
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user