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

Method redo

src/commands/create_group_command.py:119–144  ·  view source on GitHub ↗

Re-execute the group creation.

(self)

Source from the content-addressed store, hash-verified

117 return False
118
119 def redo(self) -> bool:
120 """Re-execute the group creation."""
121 # For redo, we can re-execute if the group still exists
122 if self.created_group:
123 try:
124 # Add back to graph
125 self.node_graph.addItem(self.created_group)
126
127 # Add back to groups list
128 if not hasattr(self.node_graph, 'groups'):
129 self.node_graph.groups = []
130
131 # Check if group is already in the list to prevent duplicates
132 if self.created_group not in self.node_graph.groups:
133 self.node_graph.groups.append(self.created_group)
134
135 print(f"Redid creation of group '{self.created_group.name}'")
136 self._mark_executed()
137 return True
138
139 except Exception as e:
140 print(f"Failed to redo group creation: {e}")
141 return False
142 else:
143 # If group was destroyed, re-execute from scratch
144 return self.execute()
145
146 def _get_member_nodes(self) -> List:
147 """Get the actual node objects for the member UUIDs."""

Callers 1

test_command_redoMethod · 0.95

Calls 2

executeMethod · 0.95
_mark_executedMethod · 0.80

Tested by 1

test_command_redoMethod · 0.76