From 79a285cc62d538154e110c0b49de20f3d68bc10e Mon Sep 17 00:00:00 2001 From: angloth <angus.lothian@hotmail.com> Date: Sun, 8 Mar 2020 19:23:39 +0100 Subject: [PATCH] Rename connect_destination_port to connect_destination and connect_source_port to connect_source --- b_asic/port.py | 4 ++-- b_asic/signal.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/b_asic/port.py b/b_asic/port.py index 958917c9..2b83eafd 100644 --- a/b_asic/port.py +++ b/b_asic/port.py @@ -122,7 +122,7 @@ class InputPort(Port): self._signal = signal if not signal.port_is_destination(self): # Connect this inputport as destination for this signal if it isn't already. - signal.connect_destination_port(self) + signal.connect_destination(self) def disconnect_signal(self, i: int = 0) -> None: assert 0 <= i < self.signal_count(), "Signal Index out of range." @@ -174,7 +174,7 @@ class OutputPort(Port): self._signals.append(signal) if not signal.port_is_source(self): # Connect this outputport to the signal if it isn't already - signal.connect_source_port(self) + signal.connect_source(self) def disconnect_signal(self, i: int = 0) -> None: assert 0 <= i < self.signal_count(), "Signal index out of bounds." diff --git a/b_asic/signal.py b/b_asic/signal.py index f6683a61..ef1a4597 100644 --- a/b_asic/signal.py +++ b/b_asic/signal.py @@ -22,13 +22,13 @@ class Signal(AbstractGraphComponent): super().__init__(name) self._source = source - self._destination = destination + self._destination = destination if source is not None: - self.connect_source_port(source) + self.connect_source(source) if destination is not None: - self.connect_destination_port(destination) + self.connect_destination(destination) @property def source(self) -> "OutputPort": @@ -40,7 +40,7 @@ class Signal(AbstractGraphComponent): """Returns the destination "InputPort" of the signal.""" return self._destination - def connect_source_port(self, src: "OutputPort") -> None: + def connect_source(self, src: "OutputPort") -> None: """Disconnects the previous source OutputPort of the signal and connects to the entered source OutputPort. Also connects the entered source port to the signal if it hasn't already been connected. @@ -54,7 +54,7 @@ class Signal(AbstractGraphComponent): # If the new source isn't connected to this signal then connect it. src.connect_signal(self) - def connect_destination_port(self, dest: "InputPort") -> None: + def connect_destination(self, dest: "InputPort") -> None: """Disconnects the previous destination InputPort of the signal and connects to the entered destination InputPort. Also connects the entered destination port to the signal if it hasn't already been connected. -- GitLab