Skip to content

Commit 09d8b90

Browse files
committed
some temp way to display method call
1 parent 102ea92 commit 09d8b90

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

pyjviz/method_call_rdf.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#import ipdb
2+
import textwrap
23
from . import rdf_utils
34
from . import fstriplestore
45
from . import wb_stack
56
from . import obj_tracking
67
from . import obj_utils
7-
from . import rdf_utils
88

99
method_counter = 0 # NB: should be better way to count method calls
1010
class MethodCallRDF(rdf_utils.RDFRep):
@@ -29,24 +29,28 @@ def dump_rdf_method_call_in(self):
2929
ts.dump_triple(self.uri, "<method-stack-trace>", '"' + wb_stack.wb_stack.to_string() + '"')
3030

3131
method_display_args = []
32+
more_args = False
3233
for p_name, p in self.front.args_l:
3334
if isinstance(p, obj_utils.ObjState):
34-
method_display_args.append("<b>" + p_name + "</b>")
35+
method_display_args.append(p_name)
3536
else:
36-
method_display_args.append(
37-
p_name
38-
+ " = "
39-
+ str(p).replace("<", "&lt;").replace(">", "&gt;")
40-
)
37+
more_args = True
38+
if 0:
39+
method_display_args.append(
40+
p_name
41+
+ " = "
42+
+ str(p).replace("<", "&lt;").replace(">", "&gt;")
43+
)
44+
45+
if more_args:
46+
method_display_args.append("...")
4147

42-
method_display_s = fstriplestore.to_base64(
43-
"<i>"
44-
+ self.front.method_name
45-
+ "</i>"
46-
+ " ("
47-
+ ", ".join(method_display_args)
48-
+ ")"
49-
)
48+
method_display_s = "".join([self.front.method_name,
49+
"(",
50+
", ".join(method_display_args),
51+
")"])
52+
method_display_s = "<br/>".join(textwrap.wrap(method_display_s, width = 35))
53+
method_display_s = fstriplestore.to_base64(method_display_s)
5054
ts.dump_triple(self.uri, "<method-display>", '"' + method_display_s + '"')
5155

5256
# ipdb.set_trace()

0 commit comments

Comments
 (0)