Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
a39657a0
Commit
a39657a0
authored
Apr 22, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added make_app
parent
b88a159f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
main.py
main.py
+12
-7
No files found.
main.py
View file @
a39657a0
...
@@ -8,13 +8,7 @@ from settings import (get_app_settings, get_host_keys_settings,
...
@@ -8,13 +8,7 @@ from settings import (get_app_settings, get_host_keys_settings,
get_policy_setting
)
get_policy_setting
)
def
main
():
def
make_app
(
loop
,
policy
,
host_keys_settings
,
app_settings
):
parse_command_line
()
app_settings
=
get_app_settings
(
options
)
host_keys_settings
=
get_host_keys_settings
(
options
)
policy
=
get_policy_setting
(
options
,
host_keys_settings
)
loop
=
tornado
.
ioloop
.
IOLoop
.
current
()
handlers
=
[
handlers
=
[
(
r'/'
,
IndexHandler
,
dict
(
loop
=
loop
,
policy
=
policy
,
(
r'/'
,
IndexHandler
,
dict
(
loop
=
loop
,
policy
=
policy
,
host_keys_settings
=
host_keys_settings
)),
host_keys_settings
=
host_keys_settings
)),
...
@@ -22,6 +16,17 @@ def main():
...
@@ -22,6 +16,17 @@ def main():
]
]
app
=
tornado
.
web
.
Application
(
handlers
,
**
app_settings
)
app
=
tornado
.
web
.
Application
(
handlers
,
**
app_settings
)
return
app
def
main
():
parse_command_line
()
app_settings
=
get_app_settings
(
options
)
host_keys_settings
=
get_host_keys_settings
(
options
)
policy
=
get_policy_setting
(
options
,
host_keys_settings
)
loop
=
tornado
.
ioloop
.
IOLoop
.
current
()
app
=
make_app
(
loop
,
policy
,
host_keys_settings
,
app_settings
)
app
.
listen
(
options
.
port
,
options
.
address
)
app
.
listen
(
options
.
port
,
options
.
address
)
logging
.
info
(
'Listening on {}:{}'
.
format
(
options
.
address
,
options
.
port
))
logging
.
info
(
'Listening on {}:{}'
.
format
(
options
.
address
,
options
.
port
))
loop
.
start
()
loop
.
start
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment