From 74d84cc070134494f144318b534563098a5994c4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 21 Jul 2023 04:00:44 +0100 Subject: backend : rework the update logic a little gui-frontend : hide the progress box initially, only show it when needed, make it significantly larger, disable UI elements instead of hiding them --- src/backend/update.py | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'src/backend') diff --git a/src/backend/update.py b/src/backend/update.py index face3f2..a57cb07 100644 --- a/src/backend/update.py +++ b/src/backend/update.py @@ -49,26 +49,37 @@ def start(gfx_ui=False): if is_sane == 1: sync_evrth() else: - if "packages-next" in bhst_addr: - print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + - sisyphus.getcolor.reset + "'" + actv_brch + "'" + " " + "(stable)") - print(sisyphus.getcolor.green + "\nActive binhost:" + " " + - sisyphus.getcolor.reset + "'" + bhst_addr + "'" + " " + "(testing)") - else: - print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + - sisyphus.getcolor.reset + "'" + actv_brch + "'" + " " + "(testing)") - print(sisyphus.getcolor.green + "\nActive binhost:" + " " + - sisyphus.getcolor.reset + "'" + bhst_addr + "'" + " " + "(stable)") - if gfx_ui: + if "packages-next" in bhst_addr: + print("\n\nActive branch:" + " " + "'" + + actv_brch + "'" + " " + "(stable)") + print("\n\nActive binhost:" + " " + "'" + + bhst_addr + "'" + " " + "(testing)") + else: + print("\n\nActive branch:" + " " + "'" + + actv_brch + "'" + " " + "(testing)") + print("\n\nActive binhost:" + " " + "'" + + bhst_addr + "'" + " " + "(stable)") + print("\n\nInvalid configuration!") - print("Use 'sisyphus branch --help' for help\n") + print("\nUse 'sisyphus branch --help' for help\n") for i in range(9, 0, -1): print(f"Killing application in : {i} seconds!") time.sleep(1) sys.exit(app.exec_()) # kill GUI window else: + if "packages-next" in bhst_addr: + print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + + sisyphus.getcolor.reset + "'" + actv_brch + "'" + " " + "(stable)") + print(sisyphus.getcolor.green + "\nActive binhost:" + " " + + sisyphus.getcolor.reset + "'" + bhst_addr + "'" + " " + "(testing)") + else: + print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + + sisyphus.getcolor.reset + "'" + actv_brch + "'" + " " + "(testing)") + print(sisyphus.getcolor.green + "\nActive binhost:" + " " + + sisyphus.getcolor.reset + "'" + bhst_addr + "'" + " " + "(stable)") + print(sisyphus.getcolor.bright_red + "\n\nInvalid configuration!" + sisyphus.getcolor.reset) print(sisyphus.getcolor.bright_yellow + "\nUse" + sisyphus.getcolor.reset + " " + "'" + -- cgit v1.2.3