From 71e961ba38b3982254b0ad53b244670e657ba9e8 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 8 Aug 2023 23:32:30 +0200 Subject: [PATCH] Fix annotations in NWStatus class --- novelwriter/core/status.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/novelwriter/core/status.py b/novelwriter/core/status.py index 203ad6bf..fad14027 100644 --- a/novelwriter/core/status.py +++ b/novelwriter/core/status.py @@ -127,7 +127,7 @@ class NWStatus: return self._default return "" - def name(self, key: str) -> str: + def name(self, key: str | None) -> str: """Return the name associated with a given key.""" if key in self._store: return self._store[key]["name"] @@ -135,16 +135,15 @@ class NWStatus: return self._store[self._default]["name"] return "" - def cols(self, key: str) -> tuple[int, int, int]: - """Return the colours associated with a given key. - """ + def cols(self, key: str | None) -> tuple[int, int, int]: + """Return the colours associated with a given key.""" if key in self._store: return self._store[key]["cols"] elif self._default is not None: return self._store[self._default]["cols"] return 100, 100, 100 - def count(self, key: str) -> int: + def count(self, key: str | None) -> int: """Return the count associated with a given key.""" if key in self._store: return self._store[key]["count"] @@ -152,7 +151,7 @@ class NWStatus: return self._store[self._default]["count"] return 0 - def icon(self, key: str) -> QIcon: + def icon(self, key: str | None) -> QIcon: """Return the icon associated with a given key.""" if key in self._store: return self._store[key]["icon"]