MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / parse

Method parse

schemas/generate_model.py:310–330  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

308 self.model = None
309
310 def parse(self):
311 print("Parsing: ", self.path)
312 self.model = Model()
313 tree = ElementTree.parse(self.path)
314 root = tree.getroot()
315 self.add_extension_object()
316 self.add_data_type_definition()
317 for child in root:
318 tag = child.tag[40:]
319 if tag == 'StructuredType':
320 struct = self.parse_struct(child)
321 if struct.name != 'ExtensionObject':
322 self.model.structs.append(struct)
323 self.model.struct_list.append(struct.name)
324 elif tag == 'EnumeratedType':
325 enum = self.parse_enum(child)
326 self.model.enums.append(enum)
327 self.model.enum_list.append(enum.name)
328 # else:
329 # print("Not implemented node type: " + tag + "\n")
330 return self.model
331
332 def add_extension_object(self):
333 obj = Struct()

Callers 7

string_to_valFunction · 0.45
__init__Method · 0.45
make_model_from_fileMethod · 0.45
read_nodesFunction · 0.45
eventListMethod · 0.45

Calls 5

add_extension_objectMethod · 0.95
parse_structMethod · 0.95
parse_enumMethod · 0.95
ModelClass · 0.85

Tested by 1

read_nodesFunction · 0.36