1212from meshroom .core .exception import InvalidEdgeError
1313from meshroom .core import desc , hashValue
1414
15- from typing import TYPE_CHECKING
15+ from typing import TYPE_CHECKING , Optional
1616if TYPE_CHECKING :
1717 from meshroom .core .graph import Edge
1818
@@ -529,16 +529,16 @@ def _isCompatibleWith(self, otherAttribute: "Attribute") -> bool:
529529 """
530530 return self .baseType == otherAttribute .baseType
531531
532- def connectTo (self , otherAttribute : "Attribute" ):
532+ def connectTo (self , otherAttribute : "Attribute" ) -> Optional [ "Edge" ] :
533533 """ Connect the current attribute as the source of the given one
534534 """
535535
536536 if not (graph := self .node .graph ):
537- return
537+ return None
538538
539- graph .addEdge (self , otherAttribute )
539+ return graph .addEdge (self , otherAttribute )
540540
541- def disconnectAttribute (self ):
541+ def disconnectEdge (self ):
542542 """ Disconnect the current attribute
543543 """
544544
@@ -548,7 +548,7 @@ def disconnectAttribute(self):
548548 graph .removeEdge (self )
549549
550550 if isinstance (self .root , Attribute ):
551- self .root .disconnectAttribute ()
551+ self .root .disconnectEdge ()
552552
553553 name = Property (str , getName , constant = True )
554554 fullName = Property (str , getFullName , constant = True )
@@ -1097,7 +1097,7 @@ def _haveSameStructure(self, otherAttribute: Attribute) -> bool:
10971097 def getSubAttributes (self ):
10981098 return list (self ._value )
10991099
1100- def connectTo (self , otherAttribute : "GroupAttribute" ):
1100+ def connectTo (self , otherAttribute : "GroupAttribute" ) -> Optional [ "Edge" ] :
11011101 """ Connect the current attribute as the source of the given one
11021102
11031103 It connects automatically the subgroups
@@ -1107,8 +1107,8 @@ def connectTo(self, otherAttribute: "GroupAttribute"):
11071107
11081108 for idx , subAttr in enumerate (self .getSubAttributes ()):
11091109 subAttr .connectTo (otherSubChildren [idx ])
1110-
1111- super ().connectTo (otherAttribute )
1110+
1111+ return super ().connectTo (otherAttribute )
11121112
11131113 # Override value property
11141114 value = Property (Variant , _get_value , _set_value , notify = Attribute .valueChanged )
0 commit comments