Update linting for main code

This commit is contained in:
Veronica Berglyd Olsen
2025-08-27 21:00:09 +02:00
parent 84ff1f4640
commit c174f8f931
80 changed files with 461 additions and 1653 deletions
+2 -11
View File
@@ -20,7 +20,7 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
""" # noqa
from __future__ import annotations
from typing import TYPE_CHECKING
@@ -39,7 +39,7 @@ if TYPE_CHECKING:
class NSwitchBox(QScrollArea):
"""Extension: Switch Box Widget
"""Extension: Switch Box Widget.
A widget that can hold a list of switches with labels and optional
icons. The switch toggles emits a common signal with a switch key.
@@ -55,7 +55,6 @@ class NSwitchBox(QScrollArea):
self._sIcon = baseSize
self._widgets = []
self.clear()
return
def clear(self) -> None:
"""Rebuild the content of the core widget."""
@@ -72,8 +71,6 @@ class NSwitchBox(QScrollArea):
self.setWidgetResizable(True)
self.setWidget(self._widget)
return
def addLabel(self, text: str) -> None:
"""Add a header label to the content box."""
label = QLabel(text, self)
@@ -83,7 +80,6 @@ class NSwitchBox(QScrollArea):
self._content.addWidget(label, self._index, 0, 1, 3, QtAlignLeft)
self._widgets.append(label)
self._bumpIndex()
return
def addItem(self, qIcon: QIcon, text: str, identifier: str, default: bool = False) -> None:
"""Add an item to the content box."""
@@ -104,8 +100,6 @@ class NSwitchBox(QScrollArea):
self._widgets.append(switch)
self._bumpIndex()
return
def addSeparator(self) -> None:
"""Add a blank entry in the content box."""
spacer = QWidget(self)
@@ -113,7 +107,6 @@ class NSwitchBox(QScrollArea):
self._content.addWidget(spacer, self._index, 0, 1, 3, QtAlignLeft)
self._widgets.append(spacer)
self._bumpIndex()
return
##
# Internal Functions
@@ -122,7 +115,6 @@ class NSwitchBox(QScrollArea):
def _emitSwitchSignal(self, identifier: str, state: bool) -> None:
"""Emit a signal for a switch toggle."""
self.switchToggled.emit(identifier, state)
return
def _bumpIndex(self) -> None:
"""Increase the index counter and make sure only the last
@@ -131,4 +123,3 @@ class NSwitchBox(QScrollArea):
self._content.setRowStretch(self._index, 0)
self._content.setRowStretch(self._index + 1, 1)
self._index += 1
return