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)
| 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() |