Update linting for main code
This commit is contained in:
@@ -21,7 +21,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
|
||||
|
||||
import dataclasses
|
||||
@@ -49,6 +49,7 @@ CUSTOM_COL = "custom"
|
||||
|
||||
@dataclasses.dataclass
|
||||
class StatusEntry:
|
||||
"""DataClass: Status Label Values."""
|
||||
|
||||
name: str
|
||||
color: QColor
|
||||
@@ -73,6 +74,7 @@ T_StatusKind = Literal["s", "i"]
|
||||
|
||||
|
||||
class NWStatus:
|
||||
"""Core: Status/Importance Label Class."""
|
||||
|
||||
STATUS = "s"
|
||||
IMPORT = "i"
|
||||
@@ -84,7 +86,6 @@ class NWStatus:
|
||||
self._default = None
|
||||
self._prefix = prefix[:1]
|
||||
self._height = SHARED.theme.baseIconHeight
|
||||
return
|
||||
|
||||
def __len__(self) -> int:
|
||||
return len(self._store)
|
||||
@@ -133,8 +134,6 @@ class NWStatus:
|
||||
if self._default not in self._store:
|
||||
self._default = next(iter(self._store)) if self._store else None
|
||||
|
||||
return
|
||||
|
||||
def check(self, value: str) -> str:
|
||||
"""Check the key against the stored status names."""
|
||||
if self._isKey(value) and value in self._store:
|
||||
@@ -147,13 +146,11 @@ class NWStatus:
|
||||
"""Clear the counts of references to the status entries."""
|
||||
for entry in self._store.values():
|
||||
entry.count = 0
|
||||
return
|
||||
|
||||
def increment(self, key: str | None) -> None:
|
||||
"""Increment the counter for a given entry."""
|
||||
if key and key in self._store:
|
||||
self._store[key].count += 1
|
||||
return
|
||||
|
||||
def pack(self) -> Iterable[tuple[str, dict]]:
|
||||
"""Pack the status entries into a dictionary."""
|
||||
@@ -195,7 +192,6 @@ class NWStatus:
|
||||
if entry.theme != CUSTOM_COL:
|
||||
entry.color = SHARED.theme.parseColor(entry.theme)
|
||||
entry.icon = NWStatus.createIcon(self._height, entry.color, entry.shape)
|
||||
return
|
||||
|
||||
@staticmethod
|
||||
def createIcon(height: int, color: QColor, shape: nwStatusShape) -> QIcon:
|
||||
@@ -252,7 +248,6 @@ class _ShapeCache:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._cache: dict[nwStatusShape, QPainterPath] = {}
|
||||
return
|
||||
|
||||
def getShape(self, shape: nwStatusShape) -> QPainterPath:
|
||||
"""Return a painter shape for an icon."""
|
||||
|
||||
Reference in New Issue
Block a user