# Path: lib/out.py
# def windows_out(color, msg):
# def good(msg):
# def warning(msg):
# def error(msg):
# def jump(url):
# def alert(content, url):
#     STD_OUTPUT_HANDLE = -11
# 
# Path: lib/config.py
# def load():
# def update(conf):
# def load_rule():
# def update_rule(rule):
# def rule_read(name, get_file_handle=None):
# def rule_write(name, rule):
# 
# Path: lib/update.py
# def check_update():
#     out.good("Checking update...")
#     try:
#         res = requests.get(config.load()['check_url'], timeout=10)
#         version = res.content
#         if version != config.load()['version']:
#             update()
#             return True
#         else:
#             return False
#     except:
#         out.error("Can not connect to update server!")
#         return False
# 
# Path: web/urls.py



import os
import site  # Add the boilerplate's directories to Python's site-packages path.
import tornado.web
import tornado.ioloop
from tornado.options import define, options
from lib import out
from lib import config
from lib.update import check_update
from web.urls import url_patterns
 | |__| | | (_) | | |_| | | |    | (_| |
  \_____|  \___/   \__,_| |_|     \__,_|  Ver %s

                By YSRC Team
""" % VERSION



def make_app(settings):
    return tornado.web.Application(url_patterns, **settings)


def main():
    define("port", default=int(config.load()["port"]), type=int)
    define("address", default=config.load()["ip"])
    tornado.options.parse_command_line()
    path = lambda root, *a: os.path.join(root, *a)
    ROOT = os.path.dirname(os.path.abspath(__file__))
    settings = {}
    settings['static_path'] = path(ROOT, "web", "static")
    settings['template_loader'] = tornado.template.Loader(path(ROOT, "web", "templates"))
    settings['login_url'] = "/login"
    settings['debug'] = False 
    site.addsitedir(path(ROOT, 'handlers'))
    conf = config.load()
    conf['scapy_stat'] = 'false'
    conf['tornado_stat'] = 'false'
    conf['scan_stat'] = 'false'
    conf['mix_stat'] = 'false'
    conf['tornado_run_stat'] = 'false'

# Path: lib/out.py
# def windows_out(color, msg):
# def good(msg):
# def warning(msg):
# def error(msg):
# def jump(url):
# def alert(content, url):
#     STD_OUTPUT_HANDLE = -11
# 
# Path: lib/config.py
# def load():
# def update(conf):
# def load_rule():
# def update_rule(rule):
# def rule_read(name, get_file_handle=None):
# def rule_write(name, rule):
# 
# Path: lib/update.py
# def check_update():
#     out.good("Checking update...")
#     try:
#         res = requests.get(config.load()['check_url'], timeout=10)
#         version = res.content
#         if version != config.load()['version']:
#             update()
#             return True
#         else:
#             return False
#     except:
#         out.error("Can not connect to update server!")
#         return False
# 
# Path: web/urls.py



# Path: gourdscan.py
import os
import site  # Add the boilerplate's directories to Python's site-packages path.
import tornado.web
import tornado.ioloop
from tornado.options import define, options
from lib import out
from lib import config
from lib.update import check_update
from web.urls import url_patterns

 | |__| | | (_) | | |_| | | |    | (_| |
  \_____|  \___/   \__,_| |_|     \__,_|  Ver %s

                By YSRC Team
""" % VERSION



def make_app(settings):
    return tornado.web.Application(url_patterns, **settings)


def main():
    define("port", default=int(config.load()["port"]), type=int)
    define("address", default=config.load()["ip"])
    tornado.options.parse_command_line()
    path = lambda root, *a: os.path.join(root, *a)
    ROOT = os.path.dirname(os.path.abspath(__file__))
    settings = {}
    settings['static_path'] = path(ROOT, "web", "static")
    settings['template_loader'] = tornado.template.Loader(path(ROOT, "web", "templates"))
    settings['login_url'] = "/login"
    settings['debug'] = False 
    site.addsitedir(path(ROOT, 'handlers'))
    conf = config.load()
    conf['scapy_stat'] = 'false'
    conf['tornado_stat'] = 'false'
    conf['scan_stat'] = 'false'
    conf['mix_stat'] = 'false'
    conf['tornado_run_stat'] = 'false'

    config.update(conf)