(pnode, depth, indent="")
| 337 | |
| 338 | |
| 339 | def _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 | |
| 361 | class SubHandler(object): |
no test coverage detected