Permalink
Browse files

Remove the deperecated backward compatibility for legacy config keys …

…in the engine.
  • Loading branch information...
1 parent af14390 commit ea53d23641ab3232537e6251669a76822a05ad15 @jaraco jaraco committed Jul 24, 2016
Showing with 45 additions and 58 deletions.
  1. +13 −0 CHANGES.txt
  2. +2 −28 cherrypy/_cpconfig.py
  3. +1 −1 cherrypy/daemon.py
  4. +1 −1 cherrypy/test/benchmark.py
  5. +1 −1 cherrypy/test/test_states.py
  6. +24 −24 docs/deploy.rst
  7. +3 −3 man/cherryd.1
View
@@ -1,3 +1,16 @@
+7.0.0
+-----
+
+Removed the long-deprecated backward compatibility for
+legacy config keys in the engine. Use the config for the
+namespaced-plugins instead:
+
+ - autoreload_on -> autoreload.on
+ - autoreload_frequency -> autoreload.frequency
+ - autoreload_match -> autoreload.match
+ - reload_files -> autoreload.files
+ - deadlock_poll_frequency -> timeout_monitor.frequency
+
6.2.1
-----
View
@@ -264,36 +264,10 @@ def _server_namespace_handler(k, v):
def _engine_namespace_handler(k, v):
- """Backward compatibility handler for the "engine" namespace."""
+ """Config handler for the "engine" namespace."""
engine = cherrypy.engine
- deprecated = {
- 'autoreload_on': 'autoreload.on',
- 'autoreload_frequency': 'autoreload.frequency',
- 'autoreload_match': 'autoreload.match',
- 'reload_files': 'autoreload.files',
- 'deadlock_poll_freq': 'timeout_monitor.frequency'
- }
-
- if k in deprecated:
- engine.log(
- 'WARNING: Use of engine.%s is deprecated and will be removed in a '
- 'future version. Use engine.%s instead.' % (k, deprecated[k]))
-
- if k == 'autoreload_on':
- if v:
- engine.autoreload.subscribe()
- else:
- engine.autoreload.unsubscribe()
- elif k == 'autoreload_frequency':
- engine.autoreload.frequency = v
- elif k == 'autoreload_match':
- engine.autoreload.match = v
- elif k == 'reload_files':
- engine.autoreload.files = set(v)
- elif k == 'deadlock_poll_freq':
- engine.timeout_monitor.frequency = v
- elif k == 'SIGHUP':
+ if k == 'SIGHUP':
engine.subscribe('SIGHUP', v)
elif k == 'SIGTERM':
engine.subscribe('SIGTERM', v)
View
@@ -48,7 +48,7 @@ def start(configfiles=None, daemonize=False, environment=None,
sys.exit(1)
elif fastcgi or scgi or cgi:
# Turn off autoreload when using *cgi.
- cherrypy.config.update({'engine.autoreload_on': False})
+ cherrypy.config.update({'engine.autoreload.on': False})
# Turn off the default HTTP server (which is subscribed by default).
cherrypy.server.unsubscribe()
@@ -86,7 +86,7 @@ def sizer(self, size):
'server.socket_port': 54583,
'server.max_request_header_size': 0,
'server.max_request_body_size': 0,
- 'engine.deadlock_poll_freq': 0,
+ 'engine.timeout_monitor.frequency': 0,
})
# Cheat mode on ;)
@@ -82,7 +82,7 @@ def block_implicit(self):
cherrypy.tree.mount(Root())
cherrypy.config.update({
'environment': 'test_suite',
- 'engine.deadlock_poll_freq': 0.1,
+ 'engine.timeout_monitor.frequency': 0.1,
})
db_connection.subscribe()
View
@@ -8,7 +8,7 @@ it is not uncommon to run CherryPy behind a reverse proxy
or use other servers to host the application.
.. note::
-
+
CherryPy's server has proven reliable and fast enough
for years now. If the volume of traffic you receive is
average, it will do well enough on its own. Nonetheless,
@@ -88,16 +88,16 @@ provide a 'pidfile' argument, preferably an absolute path:
Control via Supervisord
#######################
-`Supervisord <http://supervisord.org>`_ is a powerful process control
-and management tool that can perform a lot of tasks around process monitoring.
+`Supervisord <http://supervisord.org>`_ is a powerful process control
+and management tool that can perform a lot of tasks around process monitoring.
Below is a simple supervisor configuration for your CherryPy
application.
.. code-block:: ini
[unix_http_server]
- file=/tmp/supervisor.sock
+ file=/tmp/supervisor.sock
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
@@ -108,16 +108,16 @@ application.
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
-
+
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
+
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[program:myapp]
command=python server.py
- environment=PYTHONPATH=.
+ environment=PYTHONPATH=.
directory=.
This could control your server via the ``server.py`` module as
@@ -126,15 +126,15 @@ the application entry point.
.. code-block:: python
import cherrypy
-
+
class Root(object):
@cherrypy.expose
def index(self):
return "Hello World!"
-
+
cherrypy.config.update({'server.socket_port': 8090,
- 'engine.autoreload_on': False,
+ 'engine.autoreload.on': False,
'log.access_file': './access.log',
'log.error_file': './error.log'})
cherrypy.quickstart(Root())
@@ -209,7 +209,7 @@ openssl will then ask you a series of questions. You can enter whatever values a
4. Add the following lines in your CherryPy config to point to your certificate files:
-
+
.. code-block:: python
cherrypy.server.ssl_certificate = "cert.pem"
@@ -230,7 +230,7 @@ Embedding into another WSGI framework
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Though CherryPy comes with a very reliable and fast enough HTTP server,
-you may wish to integrate your CherryPy application within a
+you may wish to integrate your CherryPy application within a
different framework. To do so, we will benefit from the WSGI
interface defined in :pep:`333` and :pep:`3333`.
@@ -248,7 +248,7 @@ in a third-party WSGI server:
cherrypy.engine.start()
-- Stop the CherryPy's engine when you terminate. This will publish
+- Stop the CherryPy's engine when you terminate. This will publish
to the `"stop"` channel of the bus.
.. code-block:: python
@@ -274,13 +274,13 @@ in a third-party WSGI server:
on how the other framework handles them.
.. code-block:: python
-
+
cherrypy.engine.signals.subscribe()
- Use the ``"embedded"`` environment configuration scheme.
.. code-block:: python
-
+
cherrypy.config.update({'environment': 'embedded'})
Essentially this will disable the following:
@@ -296,7 +296,7 @@ in a third-party WSGI server:
Tornado
^^^^^^^
-You can use `tornado <http://www.tornadoweb.org/>`_ HTTP server as
+You can use `tornado <http://www.tornadoweb.org/>`_ HTTP server as
follow:
.. code-block:: python
@@ -316,7 +316,7 @@ follow:
# our WSGI application
wsgiapp = cherrypy.tree.mount(Root())
- # Disable the autoreload which won't play well
+ # Disable the autoreload which won't play well
cherrypy.config.update({'engine.autoreload.on': False})
# let's not start the CherryPy HTTP server
@@ -344,7 +344,7 @@ follow:
Twisted
^^^^^^^
-You can use `Twisted <https://twistedmatrix.com/>`_ HTTP server as
+You can use `Twisted <https://twistedmatrix.com/>`_ HTTP server as
follow:
.. code-block:: python
@@ -365,7 +365,7 @@ follow:
wsgiapp = cherrypy.tree.mount(Root())
# Configure the CherryPy's app server
- # Disable the autoreload which won't play well
+ # Disable the autoreload which won't play well
cherrypy.config.update({'engine.autoreload.on': False})
# We will be using Twisted HTTP server so let's
@@ -384,7 +384,7 @@ follow:
reactor.addSystemEventTrigger('after', 'startup', cherrypy.engine.start)
reactor.addSystemEventTrigger('before', 'shutdown', cherrypy.engine.exit)
resource = WSGIResource(reactor, reactor.getThreadPool(), wsgiapp)
-
+
Notice how we attach the bus methods to the Twisted's own lifecycle.
Save that code into a module named `cptw.py` and run it as follows:
@@ -397,7 +397,7 @@ Save that code into a module named `cptw.py` and run it as follows:
uwsgi
^^^^^
-You can use `uwsgi <http://projects.unbit.it/uwsgi/>`_ HTTP server as
+You can use `uwsgi <http://projects.unbit.it/uwsgi/>`_ HTTP server as
follow:
.. code-block:: python
@@ -470,8 +470,8 @@ In this example, we declare two domains and their ports:
- company.com:8080
- home.net:8080
-Thanks to the :class:`cherrypy.dispatch.VirtualHost` dispatcher,
-we tell CherryPy which application to dispatch to when a request
+Thanks to the :class:`cherrypy.dispatch.VirtualHost` dispatcher,
+we tell CherryPy which application to dispatch to when a request
arrives. The dispatcher looks up the requested domain and
call the according application.
@@ -542,7 +542,7 @@ be a good starting point.
}
}
-Edit this configuration to match your own paths. Then, save this configuration
+Edit this configuration to match your own paths. Then, save this configuration
into a file under ``/etc/nginx/conf.d/`` (assuming Ubuntu).
The filename is irrelevant. Then run the following commands:
View
@@ -108,7 +108,7 @@ server.socket_host = "0.0.0.0"
.br
server.socket_port = 8008
.br
-engine.autoreload_on = False
+engine.autoreload.on = False
.br
.UNINDENT
@@ -184,7 +184,7 @@ These are the built\-in environment configurations:
.INDENT 0.0
.INDENT 3.5
-\'engine.autoreload_on\': False,
+\'engine.autoreload.on\': False,
.br
\'checker.on\': False,
.br
@@ -260,4 +260,4 @@ cherrypy.org
This man page is placed in the public domain
.\" Generated by docutils manpage writer on 2009-06-15 15:07.
-.\"
+.\"

0 comments on commit ea53d23

Please sign in to comment.