1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-23 13:51:00 +00:00

pb2json allow extra fields to merge with

This commit is contained in:
slush0 2014-01-09 17:33:58 +01:00
parent 323838d41e
commit 4c55093f6a

View File

@ -76,9 +76,8 @@ def json2pb(pb, js):
def pb2json(pb):
def pb2json(pb, js={}):
''' convert google.protobuf.descriptor instance to JSON string '''
js = {}
# fields = pb.DESCRIPTOR.fields #all fields
fields = pb.ListFields() # only filled (including extensions)
for field, value in fields: