1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

trezorctl: print message name to output

This commit is contained in:
Pavol Rusnak 2017-08-09 00:52:52 +02:00
parent 8a663f7ec3
commit ff157264a2
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -81,7 +81,10 @@ def print_result(res, transport, path, verbose, is_json):
else:
click.echo(json.dumps(res, sort_keys=True, indent=4))
else:
if isinstance(res, list):
from google.protobuf import text_format, message
if isinstance(res, message.Message):
click.echo('%s {\n%s}' % (res.DESCRIPTOR.name, text_format.MessageToString(res, indent=4)))
elif isinstance(res, list):
for line in res:
click.echo(line)
elif isinstance(res, dict):