diff --git a/dzgui/const/update.py b/dzgui/const/update.py deleted file mode 100644 index 2841083..0000000 --- a/dzgui/const/update.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -This file is intended to be patched by package maintainers -repackaging DZGUI for use in different distributions. - -If DZGUI is going to be installed globally via a package manager -or other means and will reside in an immutable location, or needs to be -explicitly bound to a certain version, set the flag below to False. - -This will disable the following: - -- Version update checks at startup -- Ability to toggle between Stable/Testing branches in the Options menu -""" - -ALLOW_UPDATES = True diff --git a/dzgui/init/scan.py b/dzgui/init/scan.py deleted file mode 100644 index 891f2cc..0000000 --- a/dzgui/init/scan.py +++ /dev/null @@ -1,51 +0,0 @@ -import shutil -import subprocess - -from pathlib import Path - -""" -Find possible locations of default steam path -""" - -def get_steam_dirs() -> list[Path]: - dirs = [] - # pass 1 - if shutil.which("locate") is not None: - # TODO: config or steamapps path? cf. LIBRARYFOLDERS_PATH - proc = subprocess.run( - ["/usr/bin/locate", "Steam/config/libraryfolders.vdf"], - capture_output=True, - text=True - ) - - if proc.returncode == 0: - for d in proc.stdout.splitlines(): - dirs.append(Path(d)) - return dirs - - # pass 2 - for d in Path.home().rglob("Steam/config/libraryfolders.vdf"): - dirs.append(d) - - # pass 3 - # if still nothing, let them select it - # prompt what the dir should look like - if len(dirs) == 0: - print("none found") - return dirs - - -dirs = get_steam_dirs() -print(dirs) - -# TODO: present these in a group of radio buttons -""" -when user toggles radio button, updates text saying -"this is the standard steam location on debian" etc. - -if None or if not satisfied, pop a filepicker and choose -if selection was custom, it has to have a libraryfolders.vdf -keeps next button grayed out until requirements are satisfied - -Cancel Next -""" diff --git a/dzgui/init/update.py b/dzgui/init/update.py index 2744836..e4c08e6 100644 --- a/dzgui/init/update.py +++ b/dzgui/init/update.py @@ -29,9 +29,9 @@ def check_updates(version: str) -> str | None: try: latest = get_latest_release() if latest is None: - return + return None if Version(version) >= Version(latest): - return + return None return latest except Exception: - return + return None diff --git a/dzgui/views/components/icon.py b/dzgui/views/components/icon.py index 0ade27e..a8abd11 100644 --- a/dzgui/views/components/icon.py +++ b/dzgui/views/components/icon.py @@ -1,10 +1,11 @@ import gi + gi.require_version("Gtk", "3.0") from gi.repository import Gtk # noqa E402 + class Icon(Gtk.Image): - def __init__(self, name: str, l_margin=0) -> None: - super().__init__(icon_name=name, - icon_size=Gtk.IconSize.BUTTON, - margin_start=l_margin + def __init__(self, name: str, l_margin: int = 0) -> None: + super().__init__( + icon_name=name, icon_size=Gtk.IconSize.BUTTON, margin_start=l_margin ) diff --git a/dzgui/views/dialogs/watcher.py b/dzgui/views/dialogs/watcher.py deleted file mode 100644 index 2b56d30..0000000 --- a/dzgui/views/dialogs/watcher.py +++ /dev/null @@ -1,18 +0,0 @@ -import gi -gi.require_version("Gtk", "3.0") -from gi.repository import Gtk # noqa - -class Watcher(Gtk.Dialog): - def __init__(): - super().__init__() - pass - - def bump_progress(self): - self.set_secondary_text("FOO") - -#w = Watcher() -#thread = threading() -## compute here -#GLib.idle_add(self._bump_progress) -## raise window: -#Gdk.present_with_time(Gdk.CURRENT_TIME)