Re-execute the group creation.
(self)
| 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.""" |