diff options
| author | Sergey Shepelev <temotor@gmail.com> | 2014-04-23 13:27:49 +0400 |
|---|---|---|
| committer | Sergey Shepelev <temotor@gmail.com> | 2014-04-23 15:15:22 +0400 |
| commit | 1b9f0f0edb285be01bc570b1f64ee2aa2cba49db (patch) | |
| tree | 90dff04380efcae8250730f9832c4ab2c786f338 /doc/modules | |
| parent | 92d12567b20dbe159a1a8a8db4d2cd05d15e6588 (diff) | |
| download | eventlet-1b9f0f0edb285be01bc570b1f64ee2aa2cba49db.tar.gz | |
python3 compatibility: print function
Diffstat (limited to 'doc/modules')
| -rw-r--r-- | doc/modules/wsgi.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/modules/wsgi.rst b/doc/modules/wsgi.rst index 401ea99..aa011d7 100644 --- a/doc/modules/wsgi.rst +++ b/doc/modules/wsgi.rst @@ -1,7 +1,7 @@ :mod:`wsgi` -- WSGI server =========================== -The wsgi module provides a simple and easy way to start an event-driven +The wsgi module provides a simple and easy way to start an event-driven `WSGI <http://wsgi.org/wsgi/>`_ server. This can serve as an embedded web server in an application, or as the basis for a more full-featured web server package. One such package is `Spawning <http://pypi.python.org/pypi/Spawning/>`_. @@ -10,11 +10,11 @@ To launch a wsgi server, simply create a socket and call :func:`eventlet.wsgi.se from eventlet import wsgi import eventlet - + def hello_world(env, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello, World!\r\n'] - + wsgi.server(eventlet.listen(('', 8090)), hello_world) @@ -55,14 +55,14 @@ For example:: import eventlet def hook(env, arg1, arg2, kwarg3=None, kwarg4=None): - print 'Hook called: %s %s %s %s %s' % (env, arg1, arg2, kwarg3, kwarg4) - + print('Hook called: %s %s %s %s %s' % (env, arg1, arg2, kwarg3, kwarg4)) + def hello_world(env, start_response): env['eventlet.posthooks'].append( (hook, ('arg1', 'arg2'), {'kwarg3': 3, 'kwarg4': 4})) start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello, World!\r\n'] - + wsgi.server(eventlet.listen(('', 8090)), hello_world) The above code will print the WSGI environment and the other passed function |
