Skip to content

Commit

Permalink
Merge branch 'cheroot' of git://github.com/jzellman/webpy into jzellm…
Browse files Browse the repository at this point in the history
…an-cheroot
  • Loading branch information
anandology committed Feb 28, 2018
2 parents 2d80154 + 97466ad commit 4488c5f
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 5,103 deletions.
3 changes: 0 additions & 3 deletions LICENSE.txt
@@ -1,4 +1 @@
web.py is in the public domain; it can be used for whatever purpose with absolutely no restrictions.

CherryPy WSGI server that is included in the web.py as web.wsgiserver is licensed under CherryPy License. See web/wsgiserver/LICENSE.txt for more details.

5 changes: 4 additions & 1 deletion setup.py
Expand Up @@ -11,7 +11,10 @@
maintainer='Anand Chitipothu',
maintainer_email='anandology@gmail.com',
url='http://webpy.org/',
packages=['web', 'web.wsgiserver', 'web.contrib'],
packages=['web', 'web.contrib'],
install_requires=[
'cheroot',
],
long_description="Think about the ideal way to write a web app. Write the code to make it happen.",
license="Public domain",
platforms=["any"],
Expand Down
30 changes: 2 additions & 28 deletions web/httpserver.py
Expand Up @@ -183,35 +183,9 @@ def WSGIServer(server_address, wsgi_app):
"""Creates CherryPy WSGI server listening at `server_address` to serve `wsgi_app`.
This function can be overwritten to customize the webserver or use a different webserver.
"""
from . import wsgiserver

# Default values of wsgiserver.ssl_adapters uses cherrypy.wsgiserver
# prefix. Overwriting it make it work with web.wsgiserver.
wsgiserver.ssl_adapters = {
'builtin': 'web.wsgiserver.ssl_builtin.BuiltinSSLAdapter',
'pyopenssl': 'web.wsgiserver.ssl_pyopenssl.pyOpenSSLAdapter',
}

server = wsgiserver.CherryPyWSGIServer(server_address, wsgi_app, server_name="localhost")

def create_ssl_adapter(cert, key):
# wsgiserver tries to import submodules as cherrypy.wsgiserver.foo.
# That doesn't work as not it is web.wsgiserver.
# Patching sys.modules temporarily to make it work.
import types
cherrypy = types.ModuleType('cherrypy')
cherrypy.wsgiserver = wsgiserver
sys.modules['cherrypy'] = cherrypy
sys.modules['cherrypy.wsgiserver'] = wsgiserver

from wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter
adapter = pyOpenSSLAdapter(cert, key)

# We are done with our work. Cleanup the patches.
del sys.modules['cherrypy']
del sys.modules['cherrypy.wsgiserver']
from cheroot import wsgi

return adapter
server = wsgi.Server(server_address, wsgi_app, server_name="localhost")

# SSL backward compatibility
if (server.ssl_adapter is None and
Expand Down
25 changes: 0 additions & 25 deletions web/wsgiserver/LICENSE.txt

This file was deleted.

15 changes: 0 additions & 15 deletions web/wsgiserver/__init__.py

This file was deleted.

111 changes: 0 additions & 111 deletions web/wsgiserver/ssl_builtin.py

This file was deleted.

0 comments on commit 4488c5f

Please sign in to comment.