mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-02 19:01:04 +00:00
pb2json allow extra fields to merge with
This commit is contained in:
parent
323838d41e
commit
4c55093f6a
@ -76,9 +76,8 @@ def json2pb(pb, js):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pb2json(pb):
|
def pb2json(pb, js={}):
|
||||||
''' convert google.protobuf.descriptor instance to JSON string '''
|
''' convert google.protobuf.descriptor instance to JSON string '''
|
||||||
js = {}
|
|
||||||
# fields = pb.DESCRIPTOR.fields #all fields
|
# fields = pb.DESCRIPTOR.fields #all fields
|
||||||
fields = pb.ListFields() # only filled (including extensions)
|
fields = pb.ListFields() # only filled (including extensions)
|
||||||
for field, value in fields:
|
for field, value in fields:
|
||||||
|
Loading…
Reference in New Issue
Block a user