Apply the code change.
(self)
| 99 | self.new_code = new_code |
| 100 | |
| 101 | def execute(self) -> bool: |
| 102 | """Apply the code change.""" |
| 103 | try: |
| 104 | self.node.set_code(self.new_code) |
| 105 | self._mark_executed() |
| 106 | return True |
| 107 | except Exception as e: |
| 108 | print(f"Failed to change code: {e}") |
| 109 | return False |
| 110 | |
| 111 | def undo(self) -> bool: |
| 112 | """Revert the code change.""" |