Skip to content

Commit

Permalink
document: Update names
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Aug 11, 2021
1 parent 2bd49f8 commit 19b6da5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
22 changes: 10 additions & 12 deletions orangecanvas/document/editlinksdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
Qt, QObject, QSize, QSizeF, QPointF, QRectF
)

from ..scheme import compatible_channels
from ..scheme import Node, compatible_channels
from ..registry import InputSignal, OutputSignal
from ..utils import type_str

if typing.TYPE_CHECKING:
from ..scheme import SchemeNode
IOPair = Tuple[OutputSignal, InputSignal]


Expand Down Expand Up @@ -89,14 +88,12 @@ def __setupUi(self):

self.setSizeGripEnabled(False)

def setNodes(self, source_node, sink_node):
# type: (SchemeNode, SchemeNode) -> None
def setNodes(self, source_node: Node, sink_node: Node) -> None:
"""
Set the source/sink nodes (:class:`.SchemeNode` instances)
Set the source/sink nodes (:class:`.Node` instances)
between which to edit the links.
.. note:: This should be called before :func:`setLinks`.
"""
self.scene.editWidget.setNodes(source_node, sink_node)

Expand Down Expand Up @@ -582,10 +579,10 @@ def __init__(self, parent=None, direction=Qt.LeftToRight,
self.layout().setAlignment(self.__channelLayout,
Qt.AlignVCenter | channel_alignemnt)

self.node: Optional[SchemeNode] = None
self.node: Optional[Node] = None
self.channels: Union[List[InputSignal], List[OutputSignal]] = []
if node is not None:
self.setSchemeNode(node)
self.setNode(node)

def setIconSize(self, size):
"""
Expand Down Expand Up @@ -619,11 +616,12 @@ def icon(self):
return QIcon(self.__icon)

def setSchemeNode(self, node):
# type: (SchemeNode) -> None
"""
Set an instance of `SchemeNode`. The widget will be initialized
with its icon and channels.
self.setNode(node)

def setNode(self, node: Node) -> None:
"""
Set an instance of `Node`. The widget will be initialized with its
icon and channels.
"""
self.node = node
channels: Union[List[InputSignal], List[OutputSignal]]
Expand Down
2 changes: 1 addition & 1 deletion orangecanvas/document/tests/test_editlinksdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_editlinksnode(self):
scene.addItem(node)

node = EditLinksNode(direction=Qt.RightToLeft)
node.setSchemeNode(sink_node)
node.setNode(sink_node)

node.setPos(300, 0)
scene.addItem(node)
Expand Down
14 changes: 7 additions & 7 deletions orangecanvas/document/usagestatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from AnyQt.QtCore import QCoreApplication, QSettings

from orangecanvas import config
from orangecanvas.scheme import SchemeNode, SchemeLink, Scheme
from orangecanvas.scheme import Node, Link, Scheme

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -152,7 +152,7 @@ def begin_extend_action(self, from_sink, extended_widget):
Parameters
----------
from_sink : bool
extended_widget : SchemeNode
extended_widget : Node
"""
if not self.is_enabled():
return
Expand Down Expand Up @@ -187,7 +187,7 @@ def begin_insert_action(self, via_drag, original_link):
Parameters
----------
via_drag : bool
original_link : SchemeLink
original_link : Link
"""
if not self.is_enabled():
return
Expand Down Expand Up @@ -275,7 +275,7 @@ def log_node_add(self, widget):
Parameters
----------
widget : SchemeNode
widget : Node
"""
if not self.is_enabled():
return
Expand All @@ -301,7 +301,7 @@ def log_node_remove(self, widget):
Parameters
----------
widget : SchemeNode
widget : Node
"""
if not self.is_enabled():
return
Expand All @@ -326,7 +326,7 @@ def log_link_add(self, link):
Parameters
----------
link : SchemeLink
link : Link
"""
if not self.is_enabled():
return
Expand All @@ -339,7 +339,7 @@ def log_link_remove(self, link):
Parameters
----------
link : SchemeLink
link : Link
"""
if not self.is_enabled():
return
Expand Down

0 comments on commit 19b6da5

Please sign in to comment.