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

Method get_child

opcua/common/node.py:456–475  ·  view source on GitHub ↗

get a child specified by its path from this node. A path might be: * a string representing a qualified name. * a qualified name * a list of string * a list of qualified names

(self, path)

Source from the content-addressed store, hash-verified

454 return None
455
456 def get_child(self, path):
457 """
458 get a child specified by its path from this node.
459 A path might be:
460 * a string representing a qualified name.
461 * a qualified name
462 * a list of string
463 * a list of qualified names
464 """
465 if type(path) not in (list, tuple):
466 path = [path]
467 rpath = self._make_relative_path(path)
468 bpath = ua.BrowsePath()
469 bpath.StartingNode = self.nodeid
470 bpath.RelativePath = rpath
471 result = self.server.translate_browsepaths_to_nodeids([bpath])
472 result = result[0]
473 result.StatusCode.check()
474 # FIXME: seems this method may return several nodes
475 return Node(self.server, result.Targets[0].TargetId)
476
477 def _make_relative_path(self, path):
478 rpath = ua.RelativePath()

Callers 15

get_nodeFunction · 0.80
_add_dictionaryMethod · 0.80
_get_enum_valuesFunction · 0.80
_get_enum_stringsFunction · 0.80
call_method_fullFunction · 0.80
check_custom_typeFunction · 0.80
test_delete_nodesMethod · 0.80

Calls 4

_make_relative_pathMethod · 0.95
NodeClass · 0.85
checkMethod · 0.80