MCPcopy Create free account
hub / github.com/bhowiebkr/PyFlowGraph / remove_connection

Method remove_connection

src/core/node_graph.py:646–661  ·  view source on GitHub ↗

Remove a connection, optionally using command pattern for undo/redo.

(self, connection, use_command=True)

Source from the content-addressed store, hash-verified

644 return conn
645
646 def remove_connection(self, connection, use_command=True):
647 """Remove a connection, optionally using command pattern for undo/redo."""
648 if use_command:
649 # Use command pattern
650 command = DeleteConnectionCommand(self, connection)
651 return self.execute_command(command)
652 else:
653 # Direct removal (for internal use by commands)
654 end_pin = connection.end_pin
655 connection.remove()
656 if connection in self.connections:
657 self.connections.remove(connection)
658 self.removeItem(connection)
659 if end_pin and isinstance(end_pin.node, RerouteNode):
660 end_pin.node.update_color()
661 return True
662
663 def create_reroute_node_on_connection(self, connection, position, use_command=True):
664 """Create a reroute node on a connection, optionally using command pattern."""

Callers 4

clear_graphMethod · 0.95
remove_nodeMethod · 0.95
end_drag_connectionMethod · 0.95

Calls 4

execute_commandMethod · 0.95
removeMethod · 0.80
update_colorMethod · 0.80

Tested by

no test coverage detected