From 2f9c74e13b5bac595bc91a0f23228c9ca4baee2f Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:56:47 +0900 Subject: [PATCH] fix: automod WIP --- dzgui.sh | 6 +++--- helpers/funcs | 7 ++++--- helpers/ui.py | 14 ++++---------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index d3748d9..9a63630 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.0.0.rc-29 +version=5.0.0.rc-30 #CONSTANTS aid=221100 @@ -536,10 +536,10 @@ fetch_dzq(){ fetch_helpers_by_sum(){ declare -A sums sums=( - ["ui.py"]="12fac5997612367c0716f8575046ac6d" + ["ui.py"]="ad04fee7066d5fe30fb39e875ff870d2" ["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="d2afc23090f4f1e670ac8eb1a5412579" + ["funcs"]="26a4200acd85c0e0fc71a7fe57b1e13e" ) local author="aclist" local repo="dztui" diff --git a/helpers/funcs b/helpers/funcs index 71622ba..b2a61a0 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.0.0.rc-29 +version=5.0.0.rc-30 #CONSTANTS aid=221100 @@ -1080,7 +1080,7 @@ auto_mod_install(){ echo "# Downloaded $(($total-missing)) of $total mods. ESC cancels" done | $steamsafe_zenity --pulsate --progress --title="DZG Watcher" --auto-close --no-cancel --width=500 2>/dev/null if [[ ! $? -eq 0 ]]; then - echo "User canceled connect process. Steam may have mods pending for download." + echo "User aborted connect process. Steam may have mods pending for download." exit 1 fi @@ -1103,7 +1103,8 @@ force_update(){ local update=$(check_timestamps) console_dl "$update" && $steam_cmd steam://open/downloads - return 8 + echo "Finished requesting mod updates. Steam may have some mods pending for download." + return 0 } console_dl(){ readarray -t modids <<< "$@" diff --git a/helpers/ui.py b/helpers/ui.py index bbe166b..56a4ce3 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -16,7 +16,7 @@ locale.setlocale(locale.LC_ALL, '') gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango -# 5.0.0-rc.29 +# 5.0.0-rc.30 app_name = "DZGUI" cache = {} @@ -283,13 +283,11 @@ def process_shell_return_code(transient_parent, msg, code, original_input): case 0: # success with notice popup spawn_dialog(transient_parent, msg, "NOTIFY") - pass case 1: # error with notice popup if msg == "": msg = "Something went wrong" spawn_dialog(transient_parent, msg, "NOTIFY") - pass case 2: # warn and recurse (e.g. validation failed) spawn_dialog(transient_parent, msg, "NOTIFY") @@ -308,12 +306,6 @@ def process_shell_return_code(transient_parent, msg, code, original_input): case 6: # return silently pass - case 7: - msg = "Some mods may have failed to download. Try connecting again to resync." - spawn_dialog(transient_parent, msg, "NOTIFY") - case 8: - msg = "Finished requesting mod updates. Steam may have mods pending for download." - spawn_dialog(transient_parent, msg, "NOTIFY") case 90: # used to update configs and metadata in-place treeview = transient_parent.grid.scrollable_treelist.treeview @@ -1010,7 +1002,9 @@ class TreeView(Gtk.TreeView): def load(): dialog.destroy() transient = self.get_outer_window() - process_shell_return_code(transient, proc.stdout, proc.returncode, record) + out = proc.stdout.splitlines() + msg = out[-1] + process_shell_return_code(transient, msg, proc.returncode, record) proc = call_out(self, "Connect from table", record) GLib.idle_add(load)