mirror of https://github.com/OWASP/Nettacker.git
ditching py2 msg
This commit is contained in:
parent
65937a0942
commit
752e21f26f
|
@ -1,5 +1,2 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from core.module_protocols import http
|
||||
from core.module_protocols import socket
|
||||
|
|
|
@ -7,7 +7,6 @@ from core.alert import warn
|
|||
from core.alert import info
|
||||
from core.alert import messages
|
||||
from core.color import color
|
||||
from core.compatible import check_os_compatibility
|
||||
from core.compatible import version_info
|
||||
from config import nettacker_global_config
|
||||
from core.load_modules import load_all_languages
|
||||
|
@ -40,8 +39,6 @@ def load_all_args():
|
|||
)
|
||||
)
|
||||
|
||||
# Check if compatible
|
||||
check_os_compatibility()
|
||||
reset_color()
|
||||
# Start Parser
|
||||
parser = argparse.ArgumentParser(prog="Nettacker", add_help=False)
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
from core.alert import messages
|
||||
from core.die import die_failure
|
||||
from config import nettacker_paths
|
||||
|
||||
|
@ -56,19 +55,6 @@ def python_version():
|
|||
return int(sys.version_info[0])
|
||||
|
||||
|
||||
def check_os_compatibility():
|
||||
"""
|
||||
check if framework compatible with the OS
|
||||
|
||||
Returns:
|
||||
True if compatible otherwise None
|
||||
"""
|
||||
# from core.color import finish
|
||||
if not ('linux' in os_name() or 'darwin' in os_name()):
|
||||
die_failure(messages("error_platform"))
|
||||
return True
|
||||
|
||||
|
||||
def os_name():
|
||||
"""
|
||||
OS name
|
||||
|
@ -80,9 +66,14 @@ def os_name():
|
|||
|
||||
|
||||
def check_dependencies():
|
||||
logo()
|
||||
if python_version() == 2:
|
||||
die_failure("Python2 is No longer supported")
|
||||
sys.exit("Python2 is No longer supported!")
|
||||
|
||||
# check os compatibility
|
||||
logo()
|
||||
from core.alert import messages
|
||||
if not ('linux' in os_name() or 'darwin' in os_name()):
|
||||
die_failure(messages("error_platform"))
|
||||
|
||||
external_modules = open(nettacker_paths["requirements_path"]).read().split('\n')
|
||||
for module_name in external_modules:
|
||||
|
|
|
@ -93,8 +93,6 @@ def load_all_modules():
|
|||
|
||||
|
||||
def main():
|
||||
from core.compatible import check_dependencies
|
||||
check_dependencies()
|
||||
for directory in os.listdir('modules/scan/'):
|
||||
if 'dir_scan.yaml' in directory:
|
||||
validate_module = module()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from core.parse import load
|
||||
from core.compatible import check_dependencies
|
||||
|
||||
"""
|
||||
entry point of OWASP Nettacker framework
|
||||
|
@ -9,5 +9,10 @@ entry point of OWASP Nettacker framework
|
|||
|
||||
# __check_external_modules created to check requirements before load the engine
|
||||
if __name__ == "__main__":
|
||||
check_dependencies() # check for dependencies
|
||||
|
||||
# if dependencies and OS requirements are match then load the program
|
||||
from core.parse import load
|
||||
|
||||
load() # load and parse the ARGV
|
||||
# sys.exit(main())
|
||||
|
|
Loading…
Reference in New Issue