mirror of
https://github.com/aclist/dztui.git
synced 2026-11-05 17:45:10 +01:00
chore: clear typehinting errors
This commit is contained in:
1 parent
fe0a6711f0
commit
866c88fbb0
14 files changed
+65
-43
No files matched your search
@@ -28,7 +28,9 @@ class ProxyModelManager:
|
||||
"""
|
||||
|
||||
def __init__(self, filter_man: "FilterManager") -> None:
|
||||
self.filter_cache = {}
|
||||
self.filter_cache: dict[tuple[str], tuple["FastInsertListStore", list[Any]]] = (
|
||||
{}
|
||||
)
|
||||
|
||||
self.proxy_model: "FastInsertListStore" = None
|
||||
self.filter_man = filter_man
|
||||
@@ -55,16 +57,18 @@ class ProxyModelManager:
|
||||
self.proxy_model[treeiter][4] = playercount.players
|
||||
self.proxy_model[treeiter][6] = playercount.queue
|
||||
|
||||
# FIXME: typehint -> tuple
|
||||
def append_row_to_history(
|
||||
self, history: list[str, str, str, str, int, int, int, str, int, int, str, bool]
|
||||
) -> None:
|
||||
addr = history[7]
|
||||
qport = history[8]
|
||||
|
||||
if self.control_model is None:
|
||||
raise AttributeError("Trying to append row to empty model")
|
||||
found = False
|
||||
for i, row in enumerate(self.control_model):
|
||||
if addr == row[7] and qport == row[8]:
|
||||
print("record exists in history")
|
||||
item = self.control_model.pop(i)
|
||||
self.control_model.append(item)
|
||||
found = True
|
||||
|
||||
@@ -268,8 +268,10 @@ class ServerModelManager:
|
||||
|
||||
def _parse_single_record(self, response: "A2SInfo", delete: bool = False) -> None:
|
||||
self.preserve_on_fail = True
|
||||
row = response.as_row()
|
||||
if row is None:
|
||||
try:
|
||||
row = response.as_row()
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
self.thread_man.set_cleanup_func(StoredFunc(self._cleanup_on_failure))
|
||||
return
|
||||
|
||||
@@ -301,7 +303,7 @@ class ServerModelManager:
|
||||
return
|
||||
config_man.add_saved_server(fqip)
|
||||
# 2026-05-04
|
||||
# TODO: this is valid if saved servers tab is already open,
|
||||
# FIXME: this is valid if saved servers tab is already open,
|
||||
# but not if app was just booted
|
||||
if proxy_man.has_control_model() is False:
|
||||
self._get_proxy_man().push(records)
|
||||
@@ -393,7 +395,7 @@ class ServerModelManager:
|
||||
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
||||
# customize statusbar and dialog accordingly
|
||||
self.emitter.emit("servers_loaded", self.enum)
|
||||
# TODO: destroy wait dialog first
|
||||
# FIXME: destroy wait dialog first
|
||||
# see threadman.set_cleanup_func(_, destroy_first=True)
|
||||
if show_dialog:
|
||||
dialog = ExceptionDialog(self.controller, api_warn_msg)
|
||||
|
||||
Reference in new issue
Block a user