提交 ae881113 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Fixed bug in with_ids option for pydotprint

The old behaviour used to be that the id is added only if the name of the apply node was too long and not when the name was short.
上级 95bcd449
...@@ -544,6 +544,8 @@ def pydotprint(fct, outfile=None, ...@@ -544,6 +544,8 @@ def pydotprint(fct, outfile=None,
idx = ' id='+str(topo.index(node)) idx = ' id='+str(topo.index(node))
if len(applystr)+len(idx) > max_label_size: if len(applystr)+len(idx) > max_label_size:
applystr = applystr[:max_label_size-3-len(idx)]+idx+'...' applystr = applystr[:max_label_size-3-len(idx)]+idx+'...'
else:
applystr = applystr + idx
elif len(applystr) > max_label_size: elif len(applystr) > max_label_size:
applystr = applystr[:max_label_size-3]+'...' applystr = applystr[:max_label_size-3]+'...'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论