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

Method execute

src/commands/node/property_changes.py:40–55  ·  view source on GitHub ↗

Apply the property change.

(self)

Source from the content-addressed store, hash-verified

38 self.new_value = new_value
39
40 def execute(self) -> bool:
41 """Apply the property change."""
42 try:
43 setattr(self.node, self.property_name, self.new_value)
44
45 # Special handling for certain properties
46 if self.property_name in ['code', 'gui_code']:
47 self.node.update_pins_from_code()
48 elif self.property_name in ['width', 'height']:
49 self.node.fit_size_to_content()
50
51 self._mark_executed()
52 return True
53 except Exception as e:
54 print(f"Failed to change property: {e}")
55 return False
56
57 def undo(self) -> bool:
58 """Revert the property change."""

Callers 1

Calls 3

update_pins_from_codeMethod · 0.80
fit_size_to_contentMethod · 0.80
_mark_executedMethod · 0.80

Tested by 1