Skip to content

Commit fe809a3

Browse files
committed
Merge pull request hcientist#33 from pjritee/master
bug fixes for make_visualization code and doc
2 parents 40ae9eb + d476e9a commit fe809a3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

v3/docs/make_visualizations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Calling this again will rebuild everything. Alternatively, the program can be us
1717

1818
python $OPT/make_visualizations.py make_viz.json file1.html file3.html
1919

20-
For the example we assume the `.html` files are `file1.html`, `file2.html` and `file3.html` and that `file1.html` will have visualizations for `prog1_1.py` and `prog1_2.py`; `file2.html` will have a visualization for `prog2_1.py`; and `file3.html` will have a visualization for `prog3_1.py`. Further we assume that a local OPT server has been set up (see the following section) at the URL http://my.local.server/visualize.html.
20+
For the example we assume the `.html` files are `file1.html`, `file2.html` and `file3.html` and that `file1.html` will have visualizations for `prog1_1.py` and `prog1_2.py`; `file2.html` will have a visualization for `prog2_1.py`; and `file3.html` will have a visualization for `prog3_1.py`. Further we assume that a local OPT server has been set up at the URL http://my.local.server/visualize.html.
2121

2222
The following is a possible example for `make_viz.json`
2323

v3/make_visualizations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,17 +391,17 @@ def make_html_viz(prog, html_file, html_info):
391391
if end_head_pos == -1:
392392
print "Could not find '\n</head>' in {0}".format(html_file)
393393
return
394-
# add the updated dependency info just before </head>
395-
html_text = html_text[:end_head_pos] + PY_TUTOR_DEPEND + \
396-
html_text[end_head_pos:]
397394

398395
# all_divs is the string of all div entries to embed in the html
399396
# this is added to the header comments for easy cut and pasting
400397
# to the correct location in the document.
401398
all_divs = '\n'.join(DIV_TEXT.format(get_vizname_root(py)) for py in py_dict)
402-
399+
# add the updated dependency info just before </head>
400+
html_text = html_text[:end_head_pos] +\
401+
PY_TUTOR_DEPEND.format(js_out, all_divs) + \
402+
html_text[end_head_pos:]
403403
fd = open(html_file, 'w')
404-
fd.write(html_text.format(js_out, all_divs))
404+
fd.write(html_text)
405405
fd.close()
406406

407407

0 commit comments

Comments
 (0)