🐶 calm ruff even more

This commit is contained in:
Ondrej Samohel 2025-02-13 10:08:28 +01:00
parent 8bcab93793
commit dd05199aed
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 30 additions and 10 deletions

View file

@ -230,8 +230,8 @@ class ITrayAddon(AYONInterface):
self,
title: str,
message: str,
icon: Optional[QtWidgets.QSystemTrayIcon]=None,
msecs: Optional[int]=None) -> None:
icon: Optional[QtWidgets.QSystemTrayIcon] = None,
msecs: Optional[int] = None) -> None:
"""Show tray message.
Args:
@ -325,11 +325,11 @@ class ITrayAction(ITrayAddon):
action.triggered.connect(self.on_action_trigger)
self._action_item = action
def tray_start(self) -> None:
def tray_start(self) -> None: # noqa: PLR6301
"""Start procedure in tray tool."""
return
def tray_exit(self) -> None:
def tray_exit(self) -> None: # noqa: PLR6301
"""Cleanup method which is executed on tray shutdown."""
return
@ -357,7 +357,12 @@ class ITrayService(ITrayAddon):
@staticmethod
def services_submenu(tray_menu: QtWidgets.QMenu) -> QtWidgets.QMenu:
"""Get or create services submenu."""
"""Get or create services submenu.
Returns:
QtWidgets.QMenu: Services submenu.
"""
if ITrayService._services_submenu is None:
from qtpy import QtWidgets
@ -390,21 +395,36 @@ class ITrayService(ITrayAddon):
@staticmethod
def get_icon_running() -> QtWidgets.QIcon:
"""Get running icon."""
"""Get running icon.
Returns:
QtWidgets.QIcon: Returns "running" icon.
"""
if ITrayService._icon_running is None:
ITrayService._load_service_icons()
return ITrayService._icon_running
@staticmethod
def get_icon_idle() -> QtWidgets.QIcon:
"""Get idle icon."""
"""Get idle icon.
Returns:
QtWidgets.QIcon: Returns "idle" icon.
"""
if ITrayService._icon_idle is None:
ITrayService._load_service_icons()
return ITrayService._icon_idle
@staticmethod
def get_icon_failed() -> QtWidgets.QIcon:
"""Get failed icon."""
"""Get failed icon.
Returns:
QtWidgets.QIcon: Returns "failed" icon.
"""
if ITrayService._icon_failed is None:
ITrayService._load_service_icons()
return ITrayService._icon_failed
@ -447,7 +467,7 @@ class IHostAddon(AYONInterface):
def host_name(self) -> str:
"""Name of host which addon represents."""
def get_workfile_extensions(self) -> list[str]:
def get_workfile_extensions(self) -> list[str]: # noqa: PLR6301
"""Define workfile extensions for host.
Not all hosts support workfiles thus this is optional implementation.

View file

@ -166,7 +166,7 @@ def test_get_file_location_from_frame() -> None:
# test with custom regex
sequence = Sequence(
frame_padding=4,
frame_regex=re.compile("boo_(?P<index>(?P<padding>0*)\d+)\.exr"))
frame_regex=re.compile(r"boo_(?P<index>(?P<padding>0*)\d+)\.exr"))
file_locations_list = [
FileLocation(
file_path=Path(f"/path/to/boo_{frame}.exr"),