From 307f36958e63f2cabcd118e365702a520d1700b8 Mon Sep 17 00:00:00 2001 From: Jonas Sorgenfrei Date: Tue, 3 Feb 2026 17:11:22 +0100 Subject: [PATCH 1/4] node connections via id Closes #13 --- examples/nested_graphs.py | 13 +++++++------ flowpipe_editor/flowpipe_editor_widget.py | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/nested_graphs.py b/examples/nested_graphs.py index 54f8d85..2f356db 100644 --- a/examples/nested_graphs.py +++ b/examples/nested_graphs.py @@ -38,12 +38,13 @@ def MyNode(file): # o file<> | +--->o file<> | +--->o file<> | # | file o-----+ | file o-----+ | file o # +----------------+ +----------------------------+ +----------------+ - udpate_db_from_file = Graph(name="udpate_db_from_file") - find_file = MyNode(name="Find File", graph=udpate_db_from_file) + update_db_from_file = Graph(name="udpate_db_from_file") + #find_file = MyNode(name="Find File", graph=udpate_db_from_file) + find_file = MyNode(name="Change Lineendings", graph=update_db_from_file) values_from_file = MyNode( - name="Read Values from File", graph=udpate_db_from_file + name="Read Values from File", graph=update_db_from_file ) - update_db = MyNode(name="Update DB", graph=udpate_db_from_file) + update_db = MyNode(name="Update DB", graph=update_db_from_file) find_file.outputs["file"].connect(values_from_file.inputs["file"]) values_from_file.outputs["file"].connect(update_db.inputs["file"]) @@ -61,9 +62,9 @@ def MyNode(file): # Now the update_db graph can connect nodes to the fix_file graph find_file.outputs["file"].connect(fix_file.inputs["file_to_clean"]) fix_file.outputs["clean_file"].connect( - udpate_db_from_file["Read Values from File"].inputs["file"] + update_db_from_file["Read Values from File"].inputs["file"] ) - + print(fix_file) # Display the graph app = QtWidgets.QApplication(sys.argv) app.setWindowIcon( diff --git a/flowpipe_editor/flowpipe_editor_widget.py b/flowpipe_editor/flowpipe_editor_widget.py index 082b8ae..ce90375 100644 --- a/flowpipe_editor/flowpipe_editor_widget.py +++ b/flowpipe_editor/flowpipe_editor_widget.py @@ -166,11 +166,13 @@ def load_graph(self, graph: Graph): self.clear() self.flowpipe_graph = graph x_pos = 0 + nodes_dict = {} for row in graph.evaluation_matrix: y_pos = 0 x_diff = 250 for fp_node in row: - self._add_node(fp_node, QtCore.QPoint(int(x_pos), int(y_pos))) + qt_node =self._add_node(fp_node, QtCore.QPoint(int(x_pos), int(y_pos))) + nodes_dict[fp_node.identifier] = qt_node y_pos += 150 x_pos += x_diff for fp_node in graph.all_nodes: @@ -179,11 +181,9 @@ def load_graph(self, graph: Graph): in_index = list( connection.node.all_inputs().values() ).index(connection) - self.graph.get_node_by_name(fp_node.name).set_output( + nodes_dict[fp_node.identifier].set_output( i, - self.graph.get_node_by_name( - connection.node.name - ).input(in_index), + nodes_dict[connection.node.identifier].input(in_index), ) nodes = self.graph.all_nodes() From af6d998d13d7b281c7d440dabe2002a7f5cf41ff Mon Sep 17 00:00:00 2001 From: Jonas Sorgenfrei Date: Tue, 3 Feb 2026 17:15:55 +0100 Subject: [PATCH 2/4] cleanup example code --- examples/nested_graphs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/nested_graphs.py b/examples/nested_graphs.py index 2f356db..16e9488 100644 --- a/examples/nested_graphs.py +++ b/examples/nested_graphs.py @@ -38,9 +38,9 @@ def MyNode(file): # o file<> | +--->o file<> | +--->o file<> | # | file o-----+ | file o-----+ | file o # +----------------+ +----------------------------+ +----------------+ - update_db_from_file = Graph(name="udpate_db_from_file") - #find_file = MyNode(name="Find File", graph=udpate_db_from_file) - find_file = MyNode(name="Change Lineendings", graph=update_db_from_file) + update_db_from_file = Graph(name="update_db_from_file") + find_file = MyNode(name="Find File", graph=update_db_from_file) + values_from_file = MyNode( name="Read Values from File", graph=update_db_from_file ) @@ -64,7 +64,7 @@ def MyNode(file): fix_file.outputs["clean_file"].connect( update_db_from_file["Read Values from File"].inputs["file"] ) - print(fix_file) + # Display the graph app = QtWidgets.QApplication(sys.argv) app.setWindowIcon( From 5a09b32586f409679ba7c92611943fb1883b196f Mon Sep 17 00:00:00 2001 From: Jonas Sorgenfrei Date: Tue, 3 Feb 2026 18:04:00 +0100 Subject: [PATCH 3/4] fix pylint warning --- flowpipe_editor/widgets/properties_bin/attribute_widgets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowpipe_editor/widgets/properties_bin/attribute_widgets.py b/flowpipe_editor/widgets/properties_bin/attribute_widgets.py index 50d98b4..691f3c0 100644 --- a/flowpipe_editor/widgets/properties_bin/attribute_widgets.py +++ b/flowpipe_editor/widgets/properties_bin/attribute_widgets.py @@ -17,7 +17,8 @@ def __init__(self, label: str, parent: QtWidgets.QWidget = None): super().__init__(parent) self.label = label - def mouseDoubleClickEvent(self, event: QtGui.QMouseEvent): + def mouseDoubleClickEvent(self, event: QtGui.QMouseEvent): # pylint: disable=invalid-name + """Open a popup dialog to edit the line edit contents on double-click.""" # Open popup dialog on double-click dialog = PopupDialog(self.label, self.text(), self) dialog.exec_() From 1903dbd4532fbf924afabb0d6169c60dfc358f8e Mon Sep 17 00:00:00 2001 From: Jonas Sorgenfrei Date: Wed, 4 Feb 2026 01:19:31 +0100 Subject: [PATCH 4/4] fix typo --- examples/nested_graphs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nested_graphs.py b/examples/nested_graphs.py index 16e9488..0cb5de9 100644 --- a/examples/nested_graphs.py +++ b/examples/nested_graphs.py @@ -74,7 +74,7 @@ def MyNode(file): ) window = QtWidgets.QWidget() - window.setWindowTitle("Flowpipe-Editor Nestd Graphs Example") + window.setWindowTitle("Flowpipe-Editor Nested Graphs Example") window.resize(1100, 800) flowpipe_editor_widget = FlowpipeEditorWidget(parent=window)