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

Function uals

opcua/tools.py:274–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273
274def uals():
275 parser = argparse.ArgumentParser(description="Browse OPC-UA node and print result")
276 add_common_args(parser)
277 parser.add_argument("-l",
278 dest="long_format",
279 const=3,
280 nargs="?",
281 type=int,
282 help="use a long listing format")
283 parser.add_argument("-d",
284 "--depth",
285 default=1,
286 type=int,
287 help="Browse depth")
288
289 args = parse_args(parser)
290 if args.long_format is None:
291 args.long_format = 1
292
293 client = Client(args.url, timeout=args.timeout)
294 _configure_client_with_args(client, args)
295 client.connect()
296 try:
297 node = get_node(client, args)
298 print("Browsing node {0} at {1}\n".format(node, args.url))
299 if args.long_format == 0:
300 _lsprint_0(node, args.depth - 1)
301 elif args.long_format == 1:
302 _lsprint_1(node, args.depth - 1)
303 else:
304 _lsprint_long(node, args.depth - 1)
305 finally:
306 client.disconnect()
307 sys.exit(0)
308 print(args)
309
310
311def _lsprint_0(node, depth, indent=""):

Callers

nothing calls this directly

Calls 10

connectMethod · 0.95
disconnectMethod · 0.95
ClientClass · 0.90
add_common_argsFunction · 0.85
parse_argsFunction · 0.85
get_nodeFunction · 0.85
_lsprint_0Function · 0.85
_lsprint_1Function · 0.85
_lsprint_longFunction · 0.85

Tested by

no test coverage detected