mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 10:17:31 +02:00
chore: drop unused code
This commit is contained in:
parent
9bfa39c17e
commit
139b226959
@ -1,7 +1,7 @@
|
||||
import shutil
|
||||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def write_desktop_file(share_path: Path) -> None:
|
||||
template = f"""\
|
||||
[Desktop Entry]
|
||||
@ -16,26 +16,3 @@ def write_desktop_file(share_path: Path) -> None:
|
||||
|
||||
file = share_path / "dzgui.desktop"
|
||||
file.write_text(textwrap.dedent(template))
|
||||
|
||||
|
||||
def write_shim_file(share_path: Path) -> None:
|
||||
# FIXME: expects sys.prefix to be a venv
|
||||
file = share_path / "launch.sh"
|
||||
template=f"""\
|
||||
source {venv}/bin/activate
|
||||
python3.13 dzgui
|
||||
"""
|
||||
try:
|
||||
file.write_text(textwrap.dedent(template))
|
||||
file.chmod(file.stat().st_mode | stat.S_IEXEC)
|
||||
except OSError as e:
|
||||
logger.critical(e)
|
||||
return
|
||||
clear_old_path()
|
||||
write_desktop_file(share_path)
|
||||
|
||||
|
||||
def clear_old_path() -> None:
|
||||
home = Path.home()
|
||||
path = home / ".local/share/dzgui"
|
||||
shutil.rmtree(path)
|
||||
|
||||
@ -36,6 +36,7 @@ class ModManager:
|
||||
this manager is instantiated each time the Mods page is opened
|
||||
and persists until the next time the page is opened
|
||||
"""
|
||||
|
||||
def __init__(self, controller: "Controller") -> None:
|
||||
|
||||
self.controller = controller
|
||||
@ -89,7 +90,6 @@ class ModManager:
|
||||
return None
|
||||
tree_iter = model.get_iter(tree_path)
|
||||
mod = model.get_value(tree_iter, 2)[0]
|
||||
print(mod)
|
||||
return mod, tree_iter
|
||||
|
||||
def delete_single_mod(self, tree_path: Gtk.TreePath) -> Gtk.TreeIter | None:
|
||||
@ -120,9 +120,6 @@ class ModManager:
|
||||
def _on_mods_deleted(self, iters: list[Gtk.TreeIter]) -> None:
|
||||
for _iter in iters:
|
||||
self.store.remove(_iter)
|
||||
#model = self.treeview.get_model()
|
||||
#if model:
|
||||
# model.remove(_iter) # FIXME: do not remove from model interface directly
|
||||
remove_stale_signatures(self.prefs.paths.config, self.prefs.paths.version)
|
||||
model = self.treeview.get_model()
|
||||
if model is None:
|
||||
|
||||
@ -33,7 +33,7 @@ import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
gi.require_version("GLibUnix", "2.0")
|
||||
from gi.repository import Gtk, GLib, GLibUnix, Gdk # type: ignore # noqa E402
|
||||
from gi.repository import Gtk, GLib, GLibUnix, Gdk # type: ignore # noqa E402
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=708676
|
||||
@ -87,7 +87,6 @@ class OuterWindow(Gtk.Window):
|
||||
|
||||
# TODO: POC, trigger page change here
|
||||
MainController.loaded = True
|
||||
|
||||
MainController.populate_model(MainController.get_active_treeview())
|
||||
|
||||
def _on_delete_event(self, window: "OuterWindow", event: Gdk.EventKey) -> None:
|
||||
|
||||
@ -301,7 +301,6 @@ class Options(Gtk.Box):
|
||||
def _on_force_update_clicked(self, button: Gtk.Button) -> None:
|
||||
# TODO: unimplemented
|
||||
print("UNIMPLEMENTED")
|
||||
# wait_msg = strings.dialog.updating_mods
|
||||
|
||||
def _on_client_changed(self, combo: Gtk.ComboBoxText) -> None:
|
||||
# TODO: use two columns or constants here, not strings
|
||||
|
||||
Loading…
Reference in New Issue
Block a user