提交 5bab81bb authored 作者: carriepl's avatar carriepl

Merge pull request #3433 from sibleyd/d3viz-fixes

Remove Carriage returns and basename call in d3viz.
...@@ -75,7 +75,7 @@ def d3viz(fct, outfile, copy_deps=True, *args, **kwargs): ...@@ -75,7 +75,7 @@ def d3viz(fct, outfile, copy_deps=True, *args, **kwargs):
# Create DOT graph # Create DOT graph
formatter = PyDotFormatter(*args, **kwargs) formatter = PyDotFormatter(*args, **kwargs)
graph = formatter(fct) graph = formatter(fct)
dot_graph = escape_quotes(graph.create_dot()).replace('\n', '') dot_graph = escape_quotes(graph.create_dot()).replace('\n', '').replace('\r', '')
# Create output directory if not existing # Create output directory if not existing
outdir = os.path.dirname(outfile) outdir = os.path.dirname(outfile)
...@@ -103,7 +103,7 @@ def d3viz(fct, outfile, copy_deps=True, *args, **kwargs): ...@@ -103,7 +103,7 @@ def d3viz(fct, outfile, copy_deps=True, *args, **kwargs):
replace = { replace = {
'%% JS_DIR %%': os.path.join(dst_deps, 'js'), '%% JS_DIR %%': os.path.join(dst_deps, 'js'),
'%% CSS_DIR %%': os.path.join(dst_deps, 'css'), '%% CSS_DIR %%': os.path.join(dst_deps, 'css'),
'%% DOT_GRAPH %%': os.path.basename(dot_graph), '%% DOT_GRAPH %%': dot_graph,
} }
html = replace_patterns(template, replace) html = replace_patterns(template, replace)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论