From a1426ea0a124e627794487b7379e06a93e67a708 Mon Sep 17 00:00:00 2001 From: ekultek Date: Thu, 19 Oct 2017 07:14:51 -0500 Subject: [PATCH] had some time so making some compatibility updates (issue #7). Also edited the auto issue, you'll have your own unique ID number now --- bin/unzip_gecko.py | 5 ++++- lib/core/settings.py | 15 +++++++++++++-- var/auto_issue/github.py | 6 ++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/bin/unzip_gecko.py b/bin/unzip_gecko.py index 71ca445..1adc3d8 100644 --- a/bin/unzip_gecko.py +++ b/bin/unzip_gecko.py @@ -2,7 +2,10 @@ import os import platform import subprocess import tarfile -import ConfigParser +try: + import ConfigParser # python 2 +except ImportError: + import configparser as ConfigParser # python 3 import whichcraft diff --git a/lib/core/settings.py b/lib/core/settings.py index 145ff26..aa6c49a 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -6,9 +6,13 @@ import glob import time import difflib import logging +import string import random import subprocess -import ConfigParser +try: + import ConfigParser # python 2 +except ImportError: + import configparser as ConfigParser # python 3 import psutil import requests @@ -24,7 +28,7 @@ except NameError: # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.55" +VERSION = "1.0.56" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting @@ -498,3 +502,10 @@ def get_md5sum(url="https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/maste posted_checksum = requests.get(url).content if current_checksum == posted_checksum: return True + + +def create_identifier(chars=string.ascii_letters): + retval = [] + for _ in range(0, 7): + retval.append(random.choice(chars)) + return "".join(retval) diff --git a/var/auto_issue/github.py b/var/auto_issue/github.py index 83f7264..b25c18c 100644 --- a/var/auto_issue/github.py +++ b/var/auto_issue/github.py @@ -79,7 +79,8 @@ def request_issue_creation(): current_log_file = lib.core.settings.get_latest_log_file(lib.core.settings.CURRENT_LOG_FILE_PATH) stacktrace = __extract_stacktrace(current_log_file) - issue_title = stacktrace.split("\n")[-2] + identifier = lib.core.settings.create_identifier() + issue_title = "{} ({})".format(stacktrace.split("\n")[-2], identifier) ff_version = lib.core.settings.get_browser_version() issue_data = { @@ -112,7 +113,8 @@ def request_issue_creation(): ) urllib2.urlopen(req, timeout=10).read() lib.core.settings.logger.info(lib.core.settings.set_color( - "issue has been created successfully with the following name '{}'...".format(issue_title) + "issue has been created successfully with the following name '{}', your unique identifier " + "for this issue is '{}'...".format(issue_title, identifier) )) except Exception as e: lib.core.settings.logger.exception(lib.core.settings.set_color(