Update Detectowor.py
Fixed some double underscore issues Switched from sys.exit to raise SystemExit
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user