Pull requests

#18 Merged
Repository
chris.beelby chris.beelby
Branch
default
Repository
cherrypy cherrypy
Branch
default

Small Fixes

Author
  1. Chris Beelby avatarChris Beelby
Reviewers
Description

A couple documentation updates and some code changes.

I can find no reason in the documentation or code why the engine configuration handler accepts certain aliases for things that could otherwise be configured using the standard method. For example engine.autoreload_on vs. engine.autoreload.on. Especially in this case using the .on property is more consistent with most of the documentation. So to simplify things and reduce redundant configuration names for the same value I have removed them.

Also this fixes a bug which I detected where a global configuration file consisting of

environment = staging

engine.autoreload.on = True

would actually not set autoreload to on because the "staging" environment had a default value for engine.autoreload_on of False and since that key name didn't match engine.autoreload.on they were both loaded into the config dictionary and the autoreload_on happened to be read last making it override the value that was actually specified.

Comments (4)

  1. Joseph Tate

    I don't think we should remove the aliases. They're there to provide backwards compatibility. We SHOULD emit deprecation warnings though when they are used. With that change I think the pull request can be accepted.

  2. Chris Beelby author

    Just curious...what version are we providing backwards compatibility for? Just wondering how far back the use of those aliases goes if you know.

    I'll work on making some warnings appear so that they can be removed in the future.

  3. Chris Beelby author

    Okay. I have added new code which does as you suggest. Also I noticed I broke a test which was specifically looking for the old autoreload_on key, so I updated the test to look for autoreload.on and now it is working again.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.