Commit c6ca611d authored by Jérome Perrin's avatar Jérome Perrin

graph_editor: python3 support

parent 250d9847
...@@ -44,7 +44,7 @@ def ERP5Site_getGraphEditorGraphLayout(self, graph_editor_dict): ...@@ -44,7 +44,7 @@ def ERP5Site_getGraphEditorGraphLayout(self, graph_editor_dict):
edge['destination'], edge['destination'],
)) ))
new_graph, = pydot.graph_from_dot_data(graph.create_dot()) # pylint:disable=unpacking-non-sequence new_graph, = pydot.graph_from_dot_data(graph.create_dot().decode()) # pylint:disable=unpacking-non-sequence
# calulate the ratio from the size of the bounding box # calulate the ratio from the size of the bounding box
origin_left, origin_top, max_left, max_top = [ origin_left, origin_top, max_left, max_top = [
...@@ -55,8 +55,8 @@ def ERP5Site_getGraphEditorGraphLayout(self, graph_editor_dict): ...@@ -55,8 +55,8 @@ def ERP5Site_getGraphEditorGraphLayout(self, graph_editor_dict):
node_position_dict = dict() node_position_dict = dict()
for node in new_graph.get_nodes(): for node in new_graph.get_nodes():
# skip technical nodes # skip technical nodes (and \n bug on py3)
if node.get_name() in ('graph', 'node', 'edge'): if node.get_name() in ('graph', 'node', 'edge', '"\\n"'):
continue continue
left, top = [float(p) for p in node.get_pos()[1:-1].split(",")] left, top = [float(p) for p in node.get_pos()[1:-1].split(",")]
node_position_dict[node.get_name().strip('"')] = dict( node_position_dict[node.get_name().strip('"')] = dict(
......
Markdown is supported
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