chore: clear typehinting errors

This commit is contained in:
aclist committed 2026-05-15 19:53:00 +09:00
1 parent cacfab35bf
commit 2d265c4b9b
19 files changed
+74 -44

No files matched your search

+6 -3
View File
@@ -115,9 +115,12 @@ class FastInsertListStore(ListStore):
For this reason, it is recommended to use the extend() method to insert
an entire list of lists
"""
total = len(row)
i = len(self)
tree_iter = self.insert_with_values(i, tuple(range(total)), row)
if row is not None:
total = len(row)
i = len(self)
tree_iter = self.insert_with_values(i, tuple(range(total)), row)
else:
tree_iter = super().append(row)
return tree_iter
+5 -4
View File
@@ -57,9 +57,10 @@ class ProxyModelManager:
self.proxy_model[treeiter][4] = playercount.players
self.proxy_model[treeiter][6] = playercount.queue
# FIXME: typehint -> tuple
# TODO: use dataclass for record rows
def append_row_to_history(
self, history: list[str, str, str, str, int, int, int, str, int, int, str, bool]
self,
history: tuple[str, str, str, str, int, int, int, str, int, int, str, bool],
) -> None:
addr = history[7]
qport = history[8]
@@ -247,8 +248,8 @@ class ProxyModelManager:
self.filter_cache[filters] = (model, rows)
@deprecated("Currently unused")
def convert_model_to_list(self, model: "FastInsertListStore") -> list:
return [[el for el in row] for row in model]
# def convert_model_to_list(self, model: "FastInsertListStore") -> list:
# return [[el for el in row] for row in model]
def set_filtered(self, rows: list | None) -> None:
if rows is None:
+1
View File
@@ -236,6 +236,7 @@ class ServerModelManager:
def add_to_history(self, record: dict[str, Any]) -> None:
proxy_man = self._get_proxy_man()
row = Servers.parse_json([record])
print(type(row[0]))
proxy_man.append_row_to_history(row[0])
self.update_history()