Commit 1fee3146 by Sheng

Clean code

parent 614d6e8a
......@@ -2,7 +2,7 @@ import logging
import tornado.web
import tornado.ioloop
from tornado.options import parse_command_line, options
from tornado.options import options
from webssh.handler import IndexHandler, WsockHandler
from webssh.settings import (get_app_settings, get_host_keys_settings,
get_policy_setting, max_body_size)
......@@ -20,13 +20,12 @@ def make_handlers(loop, options):
return handlers
def make_app(handlers, app_settings):
app = tornado.web.Application(handlers, **app_settings)
return app
def make_app(handlers, settings):
return tornado.web.Application(handlers, **settings)
def main():
parse_command_line()
options.parse_command_line()
loop = tornado.ioloop.IOLoop.current()
app = make_app(make_handlers(loop, options), get_app_settings(options))
app.listen(options.port, options.address, max_body_size=max_body_size)
......
......@@ -36,7 +36,6 @@ def get_app_settings(options):
settings = dict(
template_path=os.path.join(base_dir, 'webssh', 'templates'),
static_path=os.path.join(base_dir, 'webssh', 'static'),
cookie_secret=uuid.uuid4().hex,
websocket_ping_interval=options.wpIntvl,
xsrf_cookies=(not options.debug),
debug=options.debug
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment