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

Function _lsprint_long

opcua/tools.py:339–358  ·  view source on GitHub ↗
(pnode, depth, indent="")

Source from the content-addressed store, hash-verified

337
338
339def _lsprint_long(pnode, depth, indent=""):
340 if not indent:
341 print("{0:30} {1:25} {2:25} {3:10} {4:30} {5:25}".format("DisplayName", "NodeId", "BrowseName", "DataType", "Timestamp", "Value"))
342 print("")
343 for node in pnode.get_children():
344 attrs = node.get_attributes([ua.AttributeIds.DisplayName,
345 ua.AttributeIds.BrowseName,
346 ua.AttributeIds.NodeClass,
347 ua.AttributeIds.WriteMask,
348 ua.AttributeIds.UserWriteMask,
349 ua.AttributeIds.DataType,
350 ua.AttributeIds.Value])
351 name, bname, nclass, mask, umask, dtype, val = [attr.Value.Value for attr in attrs]
352 update = attrs[-1].ServerTimestamp
353 if nclass == ua.NodeClass.Variable:
354 print("{0}{1:30} {2:25} {3:25} {4:10} {5!s:30} {6!s:25}".format(indent, name.to_string(), node.nodeid.to_string(), bname.to_string(), dtype.to_string(), update, val))
355 else:
356 print("{0}{1:30} {2:25} {3:25}".format(indent, name.to_string(), bname.to_string(), node.nodeid.to_string()))
357 if depth:
358 _lsprint_long(node, depth - 1, indent + " ")
359
360
361class SubHandler(object):

Callers 1

ualsFunction · 0.85

Calls 3

get_childrenMethod · 0.80
get_attributesMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected