From 7f5bdcf49912b76e2e85b23de8620f14c8107ac6 Mon Sep 17 00:00:00 2001 From: Cutieguwu Date: Wed, 11 Oct 2023 13:10:49 -0400 Subject: [PATCH] Update Detectowor.py Fixed some double underscore issues Switched from sys.exit to raise SystemExit --- Detectowor.py | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Detectowor.py b/Detectowor.py index 9a59234..eb2e06c 100644 --- a/Detectowor.py +++ b/Detectowor.py @@ -1,26 +1,28 @@ +#! python3 + from os import name as osname, path -__DEBUG_RUN = True -__DEBUG_LIBRARY = False -__DEBUG_SCAN = False +_DEBUG_RUN = True +_DEBUG_LIBRARY = False +_DEBUG_SCAN = False -class __DEBUG(): +class _DEBUG(): def run(report1, report2=""): - if __DEBUG_RUN == True: - print("__DEBUG_RUN >>>", report1, report2) + if _DEBUG_RUN == True: + print("_DEBUG_RUN >>>", report1, report2) def library(report1, report2=""): - if __DEBUG_LIBRARY == True: - print("__DEBUG_LIBRARY >>>", report1, report2) + if _DEBUG_LIBRARY == True: + print("_DEBUG_LIBRARY >>>", report1, report2) def scan(report1, report2=""): - if __DEBUG_SCAN == True: - print("__DEBUG_SCAN >>>", report1, report2) + if _DEBUG_SCAN == True: + print("_DEBUG_SCAN >>>", report1, report2) #Temporarily hard coded library into script def init_lib_filesearch(): - __DEBUG.scan("Loading Library - Filesearch") + _DEBUG.scan("Loading Library - Filesearch") #Fractureiser global sus_files_fractureiser @@ -71,17 +73,17 @@ def scan_summary(): pass def run(): - __DEBUG.run("Checking OS") + _DEBUG.run("Checking OS") if osname == "nt": #If OS is Windows, do Windows inits and scan, elif OS is Linux, do Linux inits and scan. - __DEBUG.run("Windows system detected.") + _DEBUG.run("Windows system detected.") print("Ending here; Windows is not supported.") exit() elif osname == "posix": - __DEBUG.run("Posix compliant (Linux) system detected") + _DEBUG.run("Posix compliant (Linux) system detected") init_lib() global threats @@ -100,6 +102,9 @@ def run(): exit() +def exit(): + raise SystemExit + if __name__ == '__main__': try: run()