()
| 272 | |
| 273 | |
| 274 | def 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 | |
| 311 | def _lsprint_0(node, depth, indent=""): |
nothing calls this directly
no test coverage detected