# Path: lib/core/data.py

# 
# Path: lib/utils/console.py
# def getTerminalSize():
#     import platform
#     current_os = platform.system()
#     tuple_xy = None
#     if current_os == 'Windows':
#         tuple_xy = _getTerminalSize_windows()
#         if tuple_xy is None:
#             tuple_xy = _getTerminalSize_tput()
#             # needed for window's python in cygwin's xterm!
#     if current_os == 'Linux' or current_os == 'Darwin' or current_os.startswith('CYGWIN'):
#         tuple_xy = _getTerminalSize_linux()
#     if tuple_xy is None:
#         print "default"
#         tuple_xy = (80, 25)  # default value
#     return tuple_xy
# 
# Path: lib/utils/versioncheck.py
# PYVERSION = sys.version.split()[0]
# 
# Path: lib/core/enums.py
# class POC_RESULT_STATUS:
#     FAIL = 0
#     SUCCESS = 1
#     RETRAY = 2
# 
# class ENGINE_MODE_STATUS:
#     THREAD = 9
#     GEVENT = 8


import threading
import time
import traceback
        import gevent
from lib.core.data import th, conf, logger, targetlist
from lib.utils.console import getTerminalSize #获取命令行窗口的宽度和高度
from lib.utils.versioncheck import PYVERSION
from lib.core.enums import POC_RESULT_STATUS, ENGINE_MODE_STATUS
        from gevent import monkey
#!/usr/bin/env python
#-*- coding:utf-8 -*-




def initEngine():
    th.thread_mode = True if conf.ENGINE is ENGINE_MODE_STATUS.THREAD else False
    #多线程模式conf.ENGINE=9
    th.module_name = conf.MODULE_NAME #脚本名
    th.s_flag = True
    th.thread_count = th.threads_num = th.THREADS_NUM #线程数
    th.scan_count = th.found_count = 0 #扫描数和发现数置0
    th.console_width = getTerminalSize()[0] - 2 #命令行窗口宽度减2
    th.is_continue = True
    th.start_time = time.time() #开始计时
    setThreadLock()
    '''
    print "#########以下是th字典##########"
    print th
    '''

# Path: lib/core/data.py

# 
# Path: lib/utils/console.py
# def getTerminalSize():
#     import platform
#     current_os = platform.system()
#     tuple_xy = None
#     if current_os == 'Windows':
#         tuple_xy = _getTerminalSize_windows()
#         if tuple_xy is None:
#             tuple_xy = _getTerminalSize_tput()
#             # needed for window's python in cygwin's xterm!
#     if current_os == 'Linux' or current_os == 'Darwin' or current_os.startswith('CYGWIN'):
#         tuple_xy = _getTerminalSize_linux()
#     if tuple_xy is None:
#         print "default"
#         tuple_xy = (80, 25)  # default value
#     return tuple_xy
# 
# Path: lib/utils/versioncheck.py
# PYVERSION = sys.version.split()[0]
# 
# Path: lib/core/enums.py
# class POC_RESULT_STATUS:
#     FAIL = 0
#     SUCCESS = 1
#     RETRAY = 2
# 
# class ENGINE_MODE_STATUS:
#     THREAD = 9
#     GEVENT = 8


# Path: lib/controller/engine.py
import threading
import time
import traceback
        import gevent
from lib.core.data import th, conf, logger, targetlist
from lib.utils.console import getTerminalSize #获取命令行窗口的宽度和高度
from lib.utils.versioncheck import PYVERSION
from lib.core.enums import POC_RESULT_STATUS, ENGINE_MODE_STATUS
        from gevent import monkey

#!/usr/bin/env python
#-*- coding:utf-8 -*-




def initEngine():
    th.thread_mode = True if conf.ENGINE is ENGINE_MODE_STATUS.THREAD else False
    #多线程模式conf.ENGINE=9
    th.module_name = conf.MODULE_NAME #脚本名
    th.s_flag = True
    th.thread_count = th.threads_num = th.THREADS_NUM #线程数
    th.scan_count = th.found_count = 0 #扫描数和发现数置0
    th.console_width = getTerminalSize()[0] - 2 #命令行窗口宽度减2
    th.is_continue = True
    th.start_time = time.time() #开始计时
    setThreadLock()
    '''
    print "#########以下是th字典##########"
    print th
    '''

    msg = 'The number of %s: %d' % ('threads' if conf.ENGINE is ENGINE_MODE_STATUS.THREAD else 'concurrent', th.threads_num)