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

Function _to_nodeid

opcua/common/node.py:18–28  ·  view source on GitHub ↗
(nodeid)

Source from the content-addressed store, hash-verified

16
17
18def _to_nodeid(nodeid):
19 if isinstance(nodeid, int):
20 return ua.TwoByteNodeId(nodeid)
21 elif isinstance(nodeid, Node):
22 return nodeid.nodeid
23 elif isinstance(nodeid, ua.NodeId):
24 return nodeid
25 elif type(nodeid) in (str, bytes):
26 return ua.NodeId.from_string(nodeid)
27 else:
28 raise ua.UaError("Could not resolve '{0}' to a type id".format(nodeid))
29
30
31class Node(object):

Callers 3

get_referencesMethod · 0.85
delete_referenceMethod · 0.85
add_referenceMethod · 0.85

Calls 1

from_stringMethod · 0.45

Tested by

no test coverage detected