Skip to content

Commit 9ff0921

Browse files
author
Philip Guo
committed
more patchies
1 parent 1071875 commit 9ff0921

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

PyTutorGAE/embedding-examples.js

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PyTutorGAE/generate_json_trace.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
def json_finalizer(input_code, output_trace):
77
ret = dict(code=input_code, trace=output_trace)
88
json_output = json.dumps(ret, indent=None) # use indent=None for most compact repr
9-
print json_output
9+
print(json_output)
1010

1111

12-
pg_logger.exec_script_str(open(sys.argv[1]).read(), json_finalizer)
12+
for f in sys.argv[1:]:
13+
pg_logger.exec_script_str(open(f).read(), json_finalizer)
1314

PyTutorGAE/js/opt-frontend.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,10 @@ $(document).ready(function() {
377377
});
378378

379379

380-
// redraw everything on window resize so that connectors are in the
381-
// right place
382-
// TODO: can be SLOW on older browsers!!!
380+
// redraw connector arrows on window resize
383381
$(window).resize(function() {
384382
if (appMode == 'visualize') {
385-
myVisualizer.updateOutput();
383+
myVisualizer.redrawConnectors();
386384
}
387385
});
388386

PyTutorGAE/js/pytutor.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,12 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
17671767
}
17681768

17691769

1770+
1771+
ExecutionVisualizer.prototype.redrawConnectors = function() {
1772+
this.jsPlumbInstance.repaintEverything();
1773+
}
1774+
1775+
17701776
// Utilities
17711777

17721778

@@ -1790,9 +1796,9 @@ var hoverBreakpointColor = medLightBlue;
17901796

17911797

17921798
function assert(cond) {
1793-
// TODO: add more precision in the error message
17941799
if (!cond) {
1795-
alert("Error: ASSERTION FAILED!!!");
1800+
alert("Assertion Failure (see console log for backtrace)");
1801+
throw 'Assertion Failure';
17961802
}
17971803
}
17981804

example-code/aliasing.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ z = y
44
y = x
55
x = z
66

7-
x = [1, 2, 3]
7+
x = [1, 2, 3] # a different [1, 2, 3] list!
88
y = x
99
x.append(4)
1010
y.append(5)
11-
z = [1, 2, 3, 4, 5]
11+
z = [1, 2, 3, 4, 5] # a different list!
1212
x.append(6)
1313
y.append(7)
1414
y = "hello"

0 commit comments

Comments
 (0)