Skip to content

Commit b8c727e

Browse files
committed
show deprecation message for node.server calls.
1 parent bd95ef1 commit b8c727e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

opcua/common/node.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
High level node object, to access node attribute
33
and browse address space
44
"""
5+
import warnings
6+
warnings.simplefilter('once', DeprecationWarning)
57
from datetime import datetime
68

79
from opcua import ua
@@ -49,6 +51,11 @@ def __init__(self, isession, nodeid):
4951
else:
5052
raise ua.UaError("argument to node must be a NodeId object or a string defining a nodeid found {0} of type {1}".format(nodeid, type(nodeid)))
5153

54+
@property
55+
def server(self):
56+
warnings.warn("Node.server attribute is deprecated. Use isession instead", DeprecationWarning)
57+
return self.isession
58+
5259
def __eq__(self, other):
5360
if isinstance(other, Node) and self.nodeid == other.nodeid:
5461
return True

0 commit comments

Comments
 (0)