File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ def lock(self):
141141 This is the same as calling :meth:`Port.set_locked` with the arg
142142 set to ``True``
143143 """
144- self .set_locked (True )
144+ self .set_locked (True , connected_ports = False )
145145
146146 def unlock (self ):
147147 """
@@ -151,18 +151,22 @@ def unlock(self):
151151 This is the same as calling :meth:`Port.set_locked` with the arg
152152 set to ``False``
153153 """
154- self .set_locked (False )
154+ self .set_locked (False , connected_ports = False )
155155
156- def set_locked (self , locked = False ):
156+ def set_locked (self , state = False , connected_ports = False ):
157157 """
158158 Sets the port locked state. When locked pipe connections can't be
159159 connected or disconnected from this port.
160160
161161 Args:
162- locked (Bool): true if locked.
162+ state (Bool): port lock state.
163+ connected_ports (Bool): apply to lock state to connected ports.
163164 """
164- self .model .locked = locked
165- self .__view .locked = locked
165+ self .model .locked = state
166+ self .__view .locked = state
167+ if connected_ports :
168+ for port in self .connected_ports ():
169+ port .set_locked (state , connected_ports = False )
166170
167171 def connected_ports (self ):
168172 """
You can’t perform that action at this time.
0 commit comments