Fix annotations in NWStatus class
This commit is contained in:
@@ -127,7 +127,7 @@ class NWStatus:
|
|||||||
return self._default
|
return self._default
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def name(self, key: str) -> str:
|
def name(self, key: str | None) -> str:
|
||||||
"""Return the name associated with a given key."""
|
"""Return the name associated with a given key."""
|
||||||
if key in self._store:
|
if key in self._store:
|
||||||
return self._store[key]["name"]
|
return self._store[key]["name"]
|
||||||
@@ -135,16 +135,15 @@ class NWStatus:
|
|||||||
return self._store[self._default]["name"]
|
return self._store[self._default]["name"]
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def cols(self, key: str) -> tuple[int, int, int]:
|
def cols(self, key: str | None) -> tuple[int, int, int]:
|
||||||
"""Return the colours associated with a given key.
|
"""Return the colours associated with a given key."""
|
||||||
"""
|
|
||||||
if key in self._store:
|
if key in self._store:
|
||||||
return self._store[key]["cols"]
|
return self._store[key]["cols"]
|
||||||
elif self._default is not None:
|
elif self._default is not None:
|
||||||
return self._store[self._default]["cols"]
|
return self._store[self._default]["cols"]
|
||||||
return 100, 100, 100
|
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."""
|
"""Return the count associated with a given key."""
|
||||||
if key in self._store:
|
if key in self._store:
|
||||||
return self._store[key]["count"]
|
return self._store[key]["count"]
|
||||||
@@ -152,7 +151,7 @@ class NWStatus:
|
|||||||
return self._store[self._default]["count"]
|
return self._store[self._default]["count"]
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def icon(self, key: str) -> QIcon:
|
def icon(self, key: str | None) -> QIcon:
|
||||||
"""Return the icon associated with a given key."""
|
"""Return the icon associated with a given key."""
|
||||||
if key in self._store:
|
if key in self._store:
|
||||||
return self._store[key]["icon"]
|
return self._store[key]["icon"]
|
||||||
|
|||||||
Reference in New Issue
Block a user