From f6888b59afcd424f5a08704f43831cdf649d546b Mon Sep 17 00:00:00 2001 From: ekultek Date: Mon, 23 Oct 2017 22:26:16 -0500 Subject: [PATCH] moved the find running opts function to settings, cleaning out the zeus.py file --- lib/core/settings.py | 13 ++++++++++++- zeus.py | 17 +++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index b795454..e0cde10 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -32,7 +32,7 @@ PATCH_ID = str(subprocess.check_output(["git", "rev-parse", "origin/master"]))[: # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.58.{}".format(PATCH_ID) +VERSION = "1.0.59" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting @@ -198,6 +198,17 @@ def create_dir(dirpath): os.mkdir(dirpath) +def find_running_opts(options): + """ + display the running options if verbose is used + """ + opts_being_used = [] + for o, v in options.__dict__.iteritems(): + if v is not None: + opts_being_used.append((o, v)) + return dict(opts_being_used) + + def set_color(org_string, level=None): """ set the console log color, this will kinda mess with the file log but whatever diff --git a/zeus.py b/zeus.py index 67f8380..2f93251 100755 --- a/zeus.py +++ b/zeus.py @@ -52,7 +52,8 @@ from lib.core.settings import ( fix_log_file, SPIDER_LOG_PATH, config_headers, - config_search_engine + config_search_engine, + find_running_opts ) if __name__ == "__main__": @@ -229,20 +230,8 @@ if __name__ == "__main__": update_zeus() shutdown() - - def __find_running_opts(): - """ - display the running options if verbose is used - """ - opts_being_used = [] - for o, v in opt.__dict__.items(): - if v is not None: - opts_being_used.append((o, v)) - return dict(opts_being_used) - - if opt.runInVerbose: - being_run = __find_running_opts() + being_run = find_running_opts(opt) logger.debug(set_color( "running with options '{}'...".format(being_run), level=10 ))