meowlib/pb/messages.py
2022-08-29 15:40:29 +02:00

17 lines
349 B
Python

from socket import MsgFlag
import protoparser
import json
def parseMessage(pb, parent):
if hasattr(pb, 'messages'):
for msg in pb.messages:
print(pb.messages)
pb = protoparser.parse_from_file("pb/messages.proto")
#print(json.dumps(pb))
print(json.dumps(pb.messages))
with open('messages.json', 'w') as f:
f.write(pb)