Rename morss/cgi.py into morss/wsgi.py
To avoid name collision with the built-in cgi libmaster
parent
4dfebe78f7
commit
47a17614ef
2
main.py
2
main.py
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from morss.__main__ import main
|
from morss.__main__ import main
|
||||||
from morss.cgi import application
|
from morss.wsgi import application
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# ran on `import morss`
|
# ran on `import morss`
|
||||||
from .morss import *
|
from .morss import *
|
||||||
from .cgi import application
|
from .wsgi import application
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from . import cgi
|
from . import wsgi
|
||||||
from . import cli
|
from . import cli
|
||||||
|
|
||||||
from .morss import MorssException
|
from .morss import MorssException
|
||||||
|
@ -28,10 +28,10 @@ def main():
|
||||||
if 'REQUEST_URI' in os.environ:
|
if 'REQUEST_URI' in os.environ:
|
||||||
# mod_cgi
|
# mod_cgi
|
||||||
|
|
||||||
app = cgi.cgi_app
|
app = wsgi.cgi_app
|
||||||
app = cgi.cgi_dispatcher(app)
|
app = wsgi.cgi_dispatcher(app)
|
||||||
app = cgi.cgi_error_handler(app)
|
app = wsgi.cgi_error_handler(app)
|
||||||
app = cgi.cgi_encode(app)
|
app = wsgi.cgi_encode(app)
|
||||||
|
|
||||||
wsgiref.handlers.CGIHandler().run(app)
|
wsgiref.handlers.CGIHandler().run(app)
|
||||||
|
|
||||||
|
@ -49,11 +49,11 @@ def main():
|
||||||
else:
|
else:
|
||||||
port = PORT
|
port = PORT
|
||||||
|
|
||||||
app = cgi.cgi_app
|
app = wsgi.cgi_app
|
||||||
app = cgi.cgi_file_handler(app)
|
app = wsgi.cgi_file_handler(app)
|
||||||
app = cgi.cgi_dispatcher(app)
|
app = wsgi.cgi_dispatcher(app)
|
||||||
app = cgi.cgi_error_handler(app)
|
app = wsgi.cgi_error_handler(app)
|
||||||
app = cgi.cgi_encode(app)
|
app = wsgi.cgi_encode(app)
|
||||||
|
|
||||||
print('Serving http://localhost:%s/' % port)
|
print('Serving http://localhost:%s/' % port)
|
||||||
httpd = wsgiref.simple_server.make_server('', port, app)
|
httpd = wsgiref.simple_server.make_server('', port, app)
|
||||||
|
|
Loading…
Reference in New Issue