mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 17:57:06 +02:00
chore: clear type annotation errors
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
This commit is contained in:
parent
6a6b4c8027
commit
a8b7ea5008
@ -53,13 +53,13 @@ def is_mission(path: Path) -> bool:
|
||||
file = path / "init.c"
|
||||
return file.exists()
|
||||
|
||||
def tokenize(mod: Path) -> dict[Any] | None:
|
||||
def tokenize(mod: Path) -> dict[str, Any] | None:
|
||||
file = mod.joinpath("meta.cpp")
|
||||
delimiter=r"\s*=\s*"
|
||||
modmeta = {}
|
||||
try:
|
||||
with open(file, "r", encoding="utf-8") as file:
|
||||
for line in file:
|
||||
with open(file, "r", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
line = line.strip().rstrip(";")
|
||||
if not line:
|
||||
continue
|
||||
|
||||
@ -62,18 +62,24 @@ class ModTreeView(ModsMixin, ContextMixin, TreeView): # type: ignore
|
||||
|
||||
self.connect("button-press-event", self.on_row_click)
|
||||
|
||||
def on_row_click(self, widget: Gtk.Widget, event: Gdk.EventButton) -> None:
|
||||
def on_row_click(self, widget: Gtk.TreeView, event: Gdk.EventButton) -> bool:
|
||||
if event.state is Gdk.ModifierType.CONTROL_MASK and event.button == 1:
|
||||
path_info = widget.get_path_at_pos(int(event.x), int(event.y))
|
||||
if path_info is None:
|
||||
return
|
||||
return False
|
||||
path, column, cellx, celly = path_info
|
||||
_iter = self.get_model().get_iter(path)
|
||||
model = self.get_model()
|
||||
if model is None:
|
||||
return False
|
||||
if path is None:
|
||||
return False
|
||||
_iter = model.get_iter(path)
|
||||
if self.get_selection().iter_is_selected(_iter):
|
||||
self.get_selection().unselect_iter(_iter)
|
||||
else:
|
||||
self.get_selection().select_iter(_iter)
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_mod_man(self) -> ModManager:
|
||||
return self.mod_man
|
||||
|
||||
Loading…
Reference in New Issue
Block a user