From 0162ee134d1b6cb03f201af3d5f4af8dfa4469f1 Mon Sep 17 00:00:00 2001 From: ekultek Date: Mon, 2 Oct 2017 12:11:09 -0500 Subject: [PATCH] added prompt for when an error occurs, 'y' will create an auto issue for you --- var/auto_issue/github.py | 4 ---- zeus.py | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/var/auto_issue/github.py b/var/auto_issue/github.py index 83e39c2..39fefa8 100644 --- a/var/auto_issue/github.py +++ b/var/auto_issue/github.py @@ -17,10 +17,6 @@ from lib.settings import ( ) -def __mask_sensitive(data, arguments): - pass - - def __get_encoded_string(filename="{}/var/auto_issue/oauth"): with open(filename.format(os.getcwd())) as data: return data.read() diff --git a/zeus.py b/zeus.py index 1082cb1..0eaeac0 100755 --- a/zeus.py +++ b/zeus.py @@ -404,8 +404,12 @@ if __name__ == "__main__": logger.exception(set_color( "ran into exception '{}'...".format(e), level=50 )) - fix_log_file() - request_issue_creation() + issue = prompt( + "would you like to create an anonymous issue on Zeus's Github page", opts="yN" + ) + if issue.lower().startswith("y"): + fix_log_file() + request_issue_creation() pass urls_to_use = get_latest_log_file(URL_LOG_PATH) @@ -436,8 +440,12 @@ if __name__ == "__main__": logger.exception(set_color( "ran into exception '{}'...".format(e), level=50 )) - fix_log_file() - request_issue_creation() + issue = prompt( + "would you like to create an anonymous issue on Zeus's Github page", opts="yN" + ) + if issue.lower().startswith("y"): + fix_log_file() + request_issue_creation() pass urls_to_use = get_latest_log_file(URL_LOG_PATH) @@ -482,8 +490,12 @@ if __name__ == "__main__": "ran into exception '{}' and cannot continue, saved to current log file...".format(e), level=50 )) - fix_log_file() - request_issue_creation() + issue = prompt( + "would you like to create an anonymous issue on Zeus's Github page", opts="yN" + ) + if issue.lower().startswith("y"): + fix_log_file() + request_issue_creation() elif opt.spiderWebSite: problem_identifiers = ["http://", "https://"] @@ -545,7 +557,10 @@ if __name__ == "__main__": )) time.sleep(2) subprocess.call("python zeus.py --help", shell=True) - + except IOError: + logger.fatal(set_color( + "provided file does not exist, make sure you have the full path...", level=50 + )) except KeyboardInterrupt: logger.error(set_color( "user aborted process...", level=40 @@ -568,8 +583,12 @@ if __name__ == "__main__": logger.exception(set_color( "ran into exception '{}' exception has been saved to log file...".format(e), level=50 )) - fix_log_file() - request_issue_creation() + issue = prompt( + "would you like to create an anonymous issue on Zeus's Github page", opts="yN" + ) + if issue.lower().startswith("y"): + fix_log_file() + request_issue_creation() fix_log_file() shutdown() \ No newline at end of file