[core] Edge: invert src/dst parameters order

This commit is contained in:
Yann Lanthony 2017-10-13 16:31:36 +02:00
parent 653cec28c9
commit 45f04e14d2

View file

@ -151,10 +151,10 @@ class Attribute(BaseObject):
class Edge(BaseObject):
def __init__(self, dst, src, parent=None):
def __init__(self, src, dst, parent=None):
super(Edge, self).__init__(parent)
self._dst = dst
self._src = src
self._dst = dst
@property
def src(self):
@ -629,7 +629,7 @@ class Graph(BaseObject):
raise RuntimeError('The attributes of the edge should be part of a common graph.')
if dstAttr in self.edges.keys():
raise RuntimeError('Destination attribute "{}" is already connected.'.format(dstAttr.fullName()))
edge = Edge(dstAttr, srcAttr)
edge = Edge(srcAttr, dstAttr)
self.edges.add(edge)
dstAttr.valueChanged.emit()
dstAttr.isLinkChanged.emit()