Source

CherryPy / cherrypy / _cptools.py

Author Commit Message Labels Comments Date
Robert Brewer
New tools.referer, and moved test_response_headers into new test_misc_tools.
Robert Brewer
Fix for #548 (Rename the before_main hook to before_handler and MainTool to HandlerTool).
Robert Brewer
cptools.session_auth was growing an unwieldy number of parameters, so I moved it from a functional approach to an object. Also moved _cptools.setargs to Tool._setargs.
Robert Brewer
Fix for #535 (Apache re-processes Range headers). _cpmodpy now uses a new "ignore_headers(['Range'])" Tool by default.
Robert Brewer
Changed every instance of 'conf' in the API to 'config'.
Robert Brewer
Fix to CachingTool for new kwargs.
Robert Brewer
Reorganized the caching tool code.
Robert Brewer
Hook priority system: 1. All hook callbacks are now wrapped in an instance of _cprequest.Hook, where failsafe, priority, and kwargs are now stored. 2. Hooks are run in order of their "priority" attribute; lower numbers first. Default 50, range 0-100, floats OK. 2. cherrypy namespace: moved "serving" to "_serving", added cherrypy.Tool, changed "LogManager" to "_LogManager". 3. Set gzip.priority to 90.
Robert Brewer
Overhaul of config system: 1. New docstring for config module! 2. Put all entries into a config namespace. New deadlock, log, request and response namespaces. 3. Request and response entries now directly modify attributes of cherrypy.request and .response, and consumer code looks up those attributes, not config. This also allows interactive inspection of defaults. 4. Removed 'log_config' config entry. Use engine.on_star…
Robert Brewer
Fix for #555 (Error propagation in hooks). Failsafe flags are now per-callback, not per-callpoint. If you want a given hook to be failsafe, either set callback.failsafe = True or (if you cannot do that) call attach(point, callback, failsafe=True). The previous semantic of 'failsafe' unfortunately also meant 'fail silently'. This has been corrected; now, when errors occur during the run of callbacks for a given call point, the last one will be raised (after all failsafe callbacks have completed).
Robert Brewer
More-explicit error when illegally passing positional arguments to tool decorators. Also, a new tool test for multiple decorators with kwargs.
Robert Brewer
Revamped session module. Much better tests. Cleanup is now in a separate, cycling Timer thread (with an entry in on_stop_engine_list). Moved cherrypy.request._session to cherrypy.serving.session.
Robert Brewer
Eliminated 'default_content_type' config entry by moving tools.response_headers to on_start_resource. If anyone still needs response headers to be set late, they can call tools.response_headers later, either in code or via a hook declared in config.
Christian Wyglendowski
1. New "expires" tool for setting the "Expires" header. 2. Tests for the expires tool.
Robert Brewer
Some tool optimizations.
Robert Brewer
Oops. Forgot to make default Tidy tools.
Robert Brewer
Fix for #512 (Cookie.expires should be optional).
Christian Wyglendowski
Fix for #533. CP3 will behave correctly and return a Fault when an XML-RPC method is not found.
Robert Brewer
Expanded baseurl tool into a new proxy tool.
Robert Brewer
Renamed lib.encodings to lib.encoding to avoid shadowing the builtin.
Robert Brewer
Fake SessionTool attributes.
Robert Brewer
Heavily cleaned the namespace for Tool objects: 1. Privatized "name", "point", "merged_args" and "setup". 2. Renamed Tool.enable to Tool.__call__. 3. Set the docstring of each Tool instance to the docstring of the tool's callable. Combined with the above, this means calltips should pick up the calltip of the callable. 4. Tools now copy the param names of self.callable to self.attributes. This allows users to "import tools" and then get conf…
Robert Brewer
Removed the wrap method from Tool, since the enable method should meet all cases better. Also fixed a bug where request.hooks was not being reinitialized on internalredirect. Also added code to guard against recursive internalredirects. Finally, fixed a couple of dict iterations that were missing iteritems.
Robert Brewer
Separated tool construction from default toolbox by renaming cherrypy.tools module to _cptools, and binding cherrypy tools to a new _cptools.default_toolbox object. Also cleaned up the top-level cherrypy namespace quite a bit, and moved some user code out of lib.cptools.