tool.py 321 B

123456789
  1. import json, os
  2. from google.protobuf import json_format
  3. def getProtobufJsonConfig(fileName, message):
  4. with open(fileName, 'r') as jsonFile:
  5. # return json_format.Parse(json.dumps(jsonFile), etc.Devices())
  6. json_etc = json.load(jsonFile)
  7. return json_format.Parse(json.dumps(json_etc), message)