@@ -117,6 +117,11 @@ def set_visible(self, visible=True, push_undo=True):
117117 visible (bool): true if visible.
118118 push_undo (bool): register the command to the undo stack. (default: True)
119119 """
120+
121+ # prevent signals from causing an infinite loop.
122+ if visible == self .visible ():
123+ return
124+
120125 undo_cmd = PortVisibleCmd (self , visible )
121126 if push_undo :
122127 undo_stack = self .node ().graph .undo_stack ()
@@ -165,8 +170,12 @@ def set_locked(self, state=False, connected_ports=True, push_undo=True):
165170 state (Bool): port lock state.
166171 connected_ports (Bool): apply to lock state to connected ports.
167172 push_undo (bool): register the command to the undo stack. (default: True)
168-
169173 """
174+
175+ # prevent signals from causing an infinite loop.
176+ if state == self .locked ():
177+ return
178+
170179 graph = self .node ().graph
171180 undo_stack = graph .undo_stack ()
172181 if state :
@@ -440,7 +449,7 @@ def add_reject_port_type(self, port_name, port_type, node_type):
440449 node_type (str): port node type.
441450 """
442451 # storing the connection constrain at the graph level instead of the
443- # port level so we don't serialize the same data for every port
452+ # port level, so we don't serialize the same data for every port
444453 # instance.
445454 self .node ().add_reject_port_type (
446455 port = self ,
0 commit comments