From 47a17614eff0caf3e7eb6e3c84fda4647981944c Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 23 Aug 2020 18:44:49 +0200 Subject: [PATCH] Rename morss/cgi.py into morss/wsgi.py To avoid name collision with the built-in cgi lib --- main.py | 2 +- morss/__init__.py | 2 +- morss/__main__.py | 20 ++++++++++---------- morss/{cgi.py => wsgi.py} | 0 4 files changed, 12 insertions(+), 12 deletions(-) rename morss/{cgi.py => wsgi.py} (100%) diff --git a/main.py b/main.py index 3fa0712..7fad225 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from morss.__main__ import main -from morss.cgi import application +from morss.wsgi import application if __name__ == '__main__': main() diff --git a/morss/__init__.py b/morss/__init__.py index b1f7595..8e8f36e 100644 --- a/morss/__init__.py +++ b/morss/__init__.py @@ -1,3 +1,3 @@ # ran on `import morss` from .morss import * -from .cgi import application +from .wsgi import application diff --git a/morss/__main__.py b/morss/__main__.py index 8287da1..3c2349a 100644 --- a/morss/__main__.py +++ b/morss/__main__.py @@ -3,7 +3,7 @@ import os import sys -from . import cgi +from . import wsgi from . import cli from .morss import MorssException @@ -28,10 +28,10 @@ def main(): if 'REQUEST_URI' in os.environ: # mod_cgi - app = cgi.cgi_app - app = cgi.cgi_dispatcher(app) - app = cgi.cgi_error_handler(app) - app = cgi.cgi_encode(app) + app = wsgi.cgi_app + app = wsgi.cgi_dispatcher(app) + app = wsgi.cgi_error_handler(app) + app = wsgi.cgi_encode(app) wsgiref.handlers.CGIHandler().run(app) @@ -49,11 +49,11 @@ def main(): else: port = PORT - app = cgi.cgi_app - app = cgi.cgi_file_handler(app) - app = cgi.cgi_dispatcher(app) - app = cgi.cgi_error_handler(app) - app = cgi.cgi_encode(app) + app = wsgi.cgi_app + app = wsgi.cgi_file_handler(app) + app = wsgi.cgi_dispatcher(app) + app = wsgi.cgi_error_handler(app) + app = wsgi.cgi_encode(app) print('Serving http://localhost:%s/' % port) httpd = wsgiref.simple_server.make_server('', port, app) diff --git a/morss/cgi.py b/morss/wsgi.py similarity index 100% rename from morss/cgi.py rename to morss/wsgi.py