From d4c1eef7840c9900478f20bde21e9c75defb4ca9 Mon Sep 17 00:00:00 2001 From: Khronion Date: Tue, 1 Nov 2022 22:02:15 -0700 Subject: [PATCH] Fix interactive prompt behavior when asking to redownload data dump referenced in #26 --- Spyglass-cli.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Spyglass-cli.py b/Spyglass-cli.py index 89cae01..6c2d823 100644 --- a/Spyglass-cli.py +++ b/Spyglass-cli.py @@ -12,7 +12,7 @@ from xml.etree import ElementTree # UPDATE THIS EVERY TIME A NEW RELEASE IS PACKAGED -VERSION = "2.0.2" +VERSION = "2.0.3" # Spyglass # Source code by Devi aka Panzer Vier @@ -200,13 +200,11 @@ def download_dump() -> None: dump_path = Path("./regions.xml.gz") if interactive: if dump_path.exists() and dump_path.is_file(): - if ( - query( - "Existing data dump found. Do you want to re-download the latest dump? (y/n, defaults to y) ", - ["y", "n", ""], - ) - == "y" - ): + resp = query( + "Existing data dump found. Do you want to re-download the latest dump? (y/n, defaults to y) ", + ["y", "n", ""], + ) + if resp == "y" or resp == "": write_log("INFO Found data dump, but re-downloading the latest..") print("Pulling data dump...") download_dump()