From fc782c71fb072aeb2b804b795bed6433c225d709 Mon Sep 17 00:00:00 2001 From: ekultek Date: Mon, 16 Oct 2017 09:39:52 -0500 Subject: [PATCH] patches an issue where zeus would only install one geckodriver version (issue #103) --- bin/unzip_gecko.py | 20 ++++++++++++++------ lib/core/settings.py | 2 +- var/auto_issue/github.py | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/unzip_gecko.py b/bin/unzip_gecko.py index 13f2ac7..a45b210 100644 --- a/bin/unzip_gecko.py +++ b/bin/unzip_gecko.py @@ -61,12 +61,15 @@ def config_gecko_version(browser_version): """ figure out which gecko version you need """ - if (55,) > browser_version > (53,): - return 17 - elif (56,) > browser_version > (55,): - return 18 - else: - return 19 + version_specs = { + (56,): 19, + (55, 54): 18, + (53, 52, 51): 17 + } + major = browser_version[0] + for key in version_specs.keys(): + if any(k == major for k in key): + return version_specs[key] def check_os(current=platform.platform()): @@ -114,6 +117,11 @@ def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz", ve file_arch = arch_info[platform.architecture()[0]] ff_version = lib.core.settings.get_browser_version() gecko_version = config_gecko_version(ff_version) + if gecko_version is None: + lib.core.settings.logger.fatal(lib.core.settings.set_color( + "your current firefox version is not supported by Zeus...", level=50 + )) + lib.core.settings.shutdown() gecko_full_filename = filename.format(os.getcwd(), gecko_version, file_arch) with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log: log.write(gecko_full_filename.split("/")[-1]) diff --git a/lib/core/settings.py b/lib/core/settings.py index b2e2d5b..13be84d 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -23,7 +23,7 @@ except NameError: # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.49.ced6" +VERSION = "1.0.49.feea" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting diff --git a/var/auto_issue/github.py b/var/auto_issue/github.py index 5804500..8b1270b 100644 --- a/var/auto_issue/github.py +++ b/var/auto_issue/github.py @@ -85,7 +85,7 @@ def request_issue_creation(): "Commands used:\n`{}`\n\n" "Log file info:\n```{}```".format( lib.core.settings.VERSION, - "({})".format(ff_version), + "{}".format(ff_version), open(lib.core.settings.GECKO_VERSION_INFO_PATH).read(), str(stacktrace), str(platform.platform()),