Skip to content

Commit a1b9b4c

Browse files
author
sarangbishal
committed
Add flag for return value
1 parent 61cdab8 commit a1b9b4c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

visualiser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
from collections import OrderedDict
44
import pydot
55

6+
67
class Visualiser(object):
78
node_count = 0
89
graph = pydot.Dot(graph_type="digraph")
9-
def __init__(self, ignore_args, show_argument_name=True):
10+
11+
def __init__(self, ignore_args, show_argument_name=True, show_return_value=True):
1012
self.show_argument_name = show_argument_name
13+
self.show_return_value = show_return_value
1114
self.ignore_args = ignore_args
1215

1316
@classmethod
@@ -85,7 +88,8 @@ def wrapper(*args, **kwargs):
8588
result = fn(*args, **kwargs)
8689

8790
# #Child Node
88-
child_label = current_function_label
91+
92+
child_label = current_function_label + f" => {result}"
8993
child_name = current_function_signature
9094
v = pydot.Node(name=child_name, label=child_label)
9195
self.graph.add_node(v)

0 commit comments

Comments
 (0)