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

Method __init__

src/commands/node/batch_operations.py:338–360  ·  view source on GitHub ↗

Initialize move multiple command. Args: node_graph: The NodeGraph instance nodes_and_positions: List of (node, old_pos, new_pos) tuples

(self, node_graph, nodes_and_positions: List[tuple])

Source from the content-addressed store, hash-verified

336 """Command for moving multiple nodes as a single undo unit."""
337
338 def __init__(self, node_graph, nodes_and_positions: List[tuple]):
339 """
340 Initialize move multiple command.
341
342 Args:
343 node_graph: The NodeGraph instance
344 nodes_and_positions: List of (node, old_pos, new_pos) tuples
345 """
346 # Create individual move commands
347 commands = []
348 node_count = len(nodes_and_positions)
349
350 if node_count == 1:
351 node = nodes_and_positions[0][0]
352 description = f"Move '{node.title}'"
353 else:
354 description = f"Move {node_count} nodes"
355
356 for node, old_pos, new_pos in nodes_and_positions:
357 move_cmd = MoveNodeCommand(node_graph, node, old_pos, new_pos)
358 commands.append(move_cmd)
359
360 super().__init__(description, commands)
361
362 def get_memory_usage(self) -> int:
363 """Estimate memory usage for move operation."""

Callers

nothing calls this directly

Calls 2

MoveNodeCommandClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected