Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
74b0cf86
Commit
74b0cf86
authored
Oct 08, 2015
by
J. Fernando Sánchez
Browse files
Added console script
parent
50e8e273
Changes
2
Hide whitespace changes
Inline
Side-by-side
senpy/__main__.py
View file @
74b0cf86
...
...
@@ -31,7 +31,7 @@ import argparse
patch_all
(
thread
=
False
)
if
__name__
==
'__
main
__'
:
def
main
()
:
parser
=
argparse
.
ArgumentParser
(
description
=
'Run a Senpy server'
)
parser
.
add_argument
(
'--level'
,
"-l"
,
...
...
@@ -47,7 +47,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'--default-plugins'
,
action
=
'store_true'
,
default
=
False
,
help
=
'
Run
the
application in debug mode
'
)
help
=
'
Load
the
default plugins
'
)
parser
.
add_argument
(
'--host'
,
type
=
str
,
default
=
"127.0.0.1"
,
...
...
@@ -68,7 +68,6 @@ if __name__ == '__main__':
app
.
debug
=
args
.
debug
sp
=
Senpy
(
app
,
args
.
plugins_folder
,
default_plugins
=
args
.
default_plugins
)
sp
.
activate_all
()
import
logging
http_server
=
WSGIServer
((
args
.
host
,
args
.
port
),
app
)
try
:
print
(
"Server running on port %s:%d. Ctrl+C to quit"
%
(
args
.
host
,
...
...
@@ -77,3 +76,6 @@ if __name__ == '__main__':
except
KeyboardInterrupt
:
http_server
.
stop
()
print
(
"Bye!"
)
if
__name__
==
'__main__'
:
main
()
setup.py
View file @
74b0cf86
...
...
@@ -36,4 +36,9 @@ extendable, so new algorithms and sources can be used.
tests_require
=
test_reqs
,
test_suite
=
"nose.collector"
,
include_package_data
=
True
,
entry_points
=
{
'console_scripts'
:
[
'senpy = senpy.__main__:main'
]
}
)
Write
Preview
Supports
Markdown
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