From d0a0a8b9c5f65717755c5da7e0cce69640385834 Mon Sep 17 00:00:00 2001 From: ekultek Date: Thu, 21 Sep 2017 10:14:42 -0500 Subject: [PATCH] patch for issue #1. Way to be the firstgit add --all --- bin/unzip_gecko.py | 23 +++++++++++++++++++---- lib/settings.py | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bin/unzip_gecko.py b/bin/unzip_gecko.py index 7d3da63..28c57df 100644 --- a/bin/unzip_gecko.py +++ b/bin/unzip_gecko.py @@ -11,10 +11,15 @@ def check_if_run(file_check="{}/bin/executed.txt"): """ check if the application has been run before by reading the executed.txt file """ - with open(file_check.format(os.getcwd())) as exc: - if "FALSE" in exc.read(): + if os.path.isfile(file_check.format(os.getcwd())): + with open(file_check.format(os.getcwd())) as exc: + if "FALSE" in exc.read(): + return True + return False + else: + with open(file_check.format(os.getcwd()), "a+") as exc: + exc.write("FALSE") return True - return False def untar_gecko(filename="{}/bin/geckodriver-v0.18.0-linux{}.tar.gz", verbose=False): @@ -76,9 +81,19 @@ def main(rewrite="{}/bin/executed.txt", verbose=False): main method """ if check_if_run(): + lib.settings.logger.info(lib.settings.set_color( + "seems this is your first time running the appication, " + "doing setup please wait..." + )) untar_gecko(verbose=verbose) if ensure_placed(verbose=verbose): with open(rewrite.format(os.getcwd()), "w") as rw: rw.write("TRUE") + lib.settings.logger.info(lib.settings.set_color( + "done, continuing process..." + )) else: - pass + if verbose: + lib.settings.logger.debug(lib.settings.set_color( + "already ran, skipping...", level=10 + )) diff --git a/lib/settings.py b/lib/settings.py index c0038a7..61f8b90 100644 --- a/lib/settings.py +++ b/lib/settings.py @@ -17,7 +17,7 @@ import bin.unzip_gecko # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.14.2e73" +VERSION = "1.0.15.c107c" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting