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
|
from os import name as osname, path
|
||||||
|
|
||||||
__DEBUG_RUN = True
|
_DEBUG_RUN = True
|
||||||
__DEBUG_LIBRARY = False
|
_DEBUG_LIBRARY = False
|
||||||
__DEBUG_SCAN = False
|
_DEBUG_SCAN = False
|
||||||
|
|
||||||
class __DEBUG():
|
class _DEBUG():
|
||||||
def run(report1, report2=""):
|
def run(report1, report2=""):
|
||||||
if __DEBUG_RUN == True:
|
if _DEBUG_RUN == True:
|
||||||
print("__DEBUG_RUN >>>", report1, report2)
|
print("_DEBUG_RUN >>>", report1, report2)
|
||||||
|
|
||||||
def library(report1, report2=""):
|
def library(report1, report2=""):
|
||||||
if __DEBUG_LIBRARY == True:
|
if _DEBUG_LIBRARY == True:
|
||||||
print("__DEBUG_LIBRARY >>>", report1, report2)
|
print("_DEBUG_LIBRARY >>>", report1, report2)
|
||||||
|
|
||||||
def scan(report1, report2=""):
|
def scan(report1, report2=""):
|
||||||
if __DEBUG_SCAN == True:
|
if _DEBUG_SCAN == True:
|
||||||
print("__DEBUG_SCAN >>>", report1, report2)
|
print("_DEBUG_SCAN >>>", report1, report2)
|
||||||
|
|
||||||
#Temporarily hard coded library into script
|
#Temporarily hard coded library into script
|
||||||
|
|
||||||
def init_lib_filesearch():
|
def init_lib_filesearch():
|
||||||
__DEBUG.scan("Loading Library - Filesearch")
|
_DEBUG.scan("Loading Library - Filesearch")
|
||||||
|
|
||||||
#Fractureiser
|
#Fractureiser
|
||||||
global sus_files_fractureiser
|
global sus_files_fractureiser
|
||||||
@@ -71,17 +73,17 @@ def scan_summary():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run():
|
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.
|
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.")
|
print("Ending here; Windows is not supported.")
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
elif osname == "posix":
|
elif osname == "posix":
|
||||||
|
|
||||||
__DEBUG.run("Posix compliant (Linux) system detected")
|
_DEBUG.run("Posix compliant (Linux) system detected")
|
||||||
init_lib()
|
init_lib()
|
||||||
|
|
||||||
global threats
|
global threats
|
||||||
@@ -100,6 +102,9 @@ def run():
|
|||||||
|
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
def exit():
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
run()
|
run()
|
||||||
|
|||||||
Reference in New Issue
Block a user