Skip to content

Commit 43d4585

Browse files
[core] GroupAttributes: refacto the disconnct method name to disconnectEdge
1 parent 196b210 commit 43d4585

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

meshroom/core/attribute.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from meshroom.core.exception import InvalidEdgeError
1313
from meshroom.core import desc, hashValue
1414

15-
from typing import TYPE_CHECKING
15+
from typing import TYPE_CHECKING, Optional
1616
if 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)

meshroom/ui/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def __init__(self, graph, edge, parent=None):
391391

392392
def redoImpl(self):
393393
super().redoImpl()
394-
self._getDstAttribute().disconnectAttribute()
394+
self._getDstAttribute().disconnectEdge()
395395
return True
396396

397397
class ListAttributeAppendCommand(GraphCommand):

0 commit comments

Comments
 (0)