Skip to content
Snippets Groups Projects
Commit 97269bac authored by angloth's avatar angloth
Browse files

Add fixes to some pylint comments

parent f2d502b4
No related branches found
No related tags found
1 merge request!9Resolve #1 "Port Interface", #8 "Port Coupling"
Checking pipeline status
......@@ -129,7 +129,7 @@ class InputPort(Port):
old_signal: Signal = self._signal
self._signal = None
if old_signal.port_is_destination(self):
# Disconnect the destination of the signal if this inputport currently is the destination
# Disconnect the dest of the signal if this inputport currently is the dest
old_signal.disconnect_destination()
old_signal.disconnect_destination()
......@@ -169,7 +169,8 @@ class OutputPort(Port):
return signal
def connect_to_signal(self, signal: Signal) -> None:
assert not self.is_connected_to_signal(signal), "Attempting to connect to Signal already connected."
assert not self.is_connected_to_signal(signal), \
"Attempting to connect to Signal already connected."
self._signals.append(signal)
if not signal.is_source(self):
# Connect this outputport to the signal if it isn't already
......@@ -184,7 +185,7 @@ class OutputPort(Port):
old_signal.disconnect_source()
def disconnect_signal_by_ref(self, signal: Signal) -> None:
"""Removes the signal that was entered from the OutputPorts signals.
"""Removes the signal that was entered from the OutputPorts signals.
If the entered signal still is connected to this port then disconnects the
entered signal from the port aswell.
......
......@@ -11,6 +11,7 @@ if TYPE_CHECKING:
class Signal(AbstractGraphComponent):
"""A connection between two ports."""
_source: "OutputPort"
_destination: "InputPort"
......@@ -106,7 +107,7 @@ class Signal(AbstractGraphComponent):
def has_source(self) -> bool:
"""Returns true if the signal is connected to a source, else false."""
return self._source is not None
def has_destination(self) -> bool:
"""Returns true if the signal is connected to a destination, else false."""
return self._destination is not None
\ No newline at end of file
return self._destination is not None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment