(graph, addr, parent='')
| 399 | |
| 400 | |
| 401 | def format_node(graph, addr, parent=''): |
| 402 | node = get_node_label(graph, addr) |
| 403 | annotation = get_node_annotation(graph, addr) |
| 404 | has_priv = priv_regex.match(node) |
| 405 | |
| 406 | # Color/Style |
| 407 | if os.isatty(1): |
| 408 | orig = style.UNDERLINE + 'jsobj@' + addr + style.END |
| 409 | |
| 410 | if has_priv: |
| 411 | node = style.BOLD + has_priv.group(1) + style.END |
| 412 | orig += ' ' + style.UNDERLINE + 'priv@' + has_priv.group(2) + style.END |
| 413 | else: |
| 414 | node = style.BOLD + node + style.END |
| 415 | else: |
| 416 | orig = 'jsobj@' + addr |
| 417 | |
| 418 | if has_priv: |
| 419 | node = has_priv.group(1) |
| 420 | orig += ' priv@' + has_priv.group(2) |
| 421 | |
| 422 | # Add the annotation |
| 423 | if annotation: |
| 424 | if os.isatty(1): |
| 425 | node += ' "' + style.PURPLE + annotation + style.END + '"' |
| 426 | else: |
| 427 | node += ' "' + annotation + '"' |
| 428 | |
| 429 | if args.no_addr: |
| 430 | return node |
| 431 | return node + ' ' + orig |
| 432 | |
| 433 | |
| 434 | def output_tree_graph(graph, data, base='', parent=''): |
no test coverage detected