patches an issue where zeus would only install one geckodriver version (issue #103)

This commit is contained in:
ekultek 2017-10-16 09:39:52 -05:00
parent 5375c15b9e
commit fc782c71fb
3 changed files with 16 additions and 8 deletions

View file

@ -61,12 +61,15 @@ def config_gecko_version(browser_version):
""" """
figure out which gecko version you need figure out which gecko version you need
""" """
if (55,) > browser_version > (53,): version_specs = {
return 17 (56,): 19,
elif (56,) > browser_version > (55,): (55, 54): 18,
return 18 (53, 52, 51): 17
else: }
return 19 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()): 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]] file_arch = arch_info[platform.architecture()[0]]
ff_version = lib.core.settings.get_browser_version() ff_version = lib.core.settings.get_browser_version()
gecko_version = config_gecko_version(ff_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) gecko_full_filename = filename.format(os.getcwd(), gecko_version, file_arch)
with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log: with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log:
log.write(gecko_full_filename.split("/")[-1]) log.write(gecko_full_filename.split("/")[-1])

View file

@ -23,7 +23,7 @@ except NameError:
# clone link # clone link
CLONE = "https://github.com/ekultek/zeus-scanner.git" CLONE = "https://github.com/ekultek/zeus-scanner.git"
# current version <major.minor.commit.patch ID> # current version <major.minor.commit.patch ID>
VERSION = "1.0.49.ced6" VERSION = "1.0.49.feea"
# colors to output depending on the version # colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
# version string formatting # version string formatting

View file

@ -85,7 +85,7 @@ def request_issue_creation():
"Commands used:\n`{}`\n\n" "Commands used:\n`{}`\n\n"
"Log file info:\n```{}```".format( "Log file info:\n```{}```".format(
lib.core.settings.VERSION, lib.core.settings.VERSION,
"({})".format(ff_version), "{}".format(ff_version),
open(lib.core.settings.GECKO_VERSION_INFO_PATH).read(), open(lib.core.settings.GECKO_VERSION_INFO_PATH).read(),
str(stacktrace), str(stacktrace),
str(platform.platform()), str(platform.platform()),