예제 #1
0
 def __init__(self):
     self._pid_store = Pids_pb2.PidStore()
     self._pids = {}
     self._name_to_pid = {}
     self._manufacturer_pids = {}
     self._manufacturer_names_to_pids = {}
     self._manufacturer_id_to_name = {}
예제 #2
0
def LoadProto(pid_file_name):
    pid_file = open(pid_file_name, 'r')
    lines = pid_file.readlines()
    pid_file.close()

    pid_store = Pids_pb2.PidStore()

    text_format.Merge('\n'.join(lines), pid_store)
    return pid_store