Commit 78b95a53 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix statecharts for Python3

parent aafa5e9a
...@@ -471,9 +471,9 @@ def render_statechart(scene, graphtree=None, keep_pos=False, dump_gfx=''): ...@@ -471,9 +471,9 @@ def render_statechart(scene, graphtree=None, keep_pos=False, dump_gfx=''):
# next to single, small states. Rule: there can't be a state with a size # next to single, small states. Rule: there can't be a state with a size
# that is less than a third of the biggest state. # that is less than a third of the biggest state.
try: try:
min_width = float(max(node.attr.get('width', 0.0) or 0.0 min_width = float(max(float(node.attr.get('width', 0.0)) or 0.0
for node in graphtree['graph'].iternodes())) for node in graphtree['graph'].iternodes()))
min_height = float(max(node.attr.get('height', 0.0) or 0.0 min_height = float(max(float(node.attr.get('height', 0.0)) or 0.0
for node in graphtree['graph'].iternodes())) for node in graphtree['graph'].iternodes()))
except ValueError as err: except ValueError as err:
LOG.debug(str(err)) LOG.debug(str(err))
...@@ -520,8 +520,8 @@ def render_statechart(scene, graphtree=None, keep_pos=False, dump_gfx=''): ...@@ -520,8 +520,8 @@ def render_statechart(scene, graphtree=None, keep_pos=False, dump_gfx=''):
dump=('-Tpng -o' + dump_gfx) if dump_gfx else '')) dump=('-Tpng -o' + dump_gfx) if dump_gfx else ''))
# bb is not visible directly - extract it from the low level api: # bb is not visible directly - extract it from the low level api:
bounding_rect = [float(val) for val in bounding_rect = [float(val) for val in
dotgraph.graphviz.agget(graph.handle, 'bb').split(',')] dotgraph.graphviz.agget(graph.handle, b'bb').split(b',')]
dot_dpi = float(dotgraph.graphviz.agget(graph.handle, 'dpi')) dot_dpi = float(dotgraph.graphviz.agget(graph.handle, b'dpi'))
#fontname = graph.graph_attr.get('fontname') #fontname = graph.graph_attr.get('fontname')
#fontsize = graph.graph_attr.get('fontsize') #fontsize = graph.graph_attr.get('fontsize')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment