summaryrefslogtreecommitdiff
path: root/cherrypy/lib/cptools.py
Commit message (Collapse)AuthorAgeFilesLines
...
* More work on tools.expires:Robert Brewer2006-07-171-1/+6
| | | | | | | 1. Now takes 'secs' arg instead of 'e_time'. 2. The 'force' arg defaults to False now. 3. Set 'force' to True to imply ignore_indicators. 4. New cherrypy.reponse.time attribute: the time.time() which is used for the 'Date' response header.
* Expanded baseurl tool into a new proxy tool.Robert Brewer2006-06-281-3/+11
|
* Renamed httptools to "http" to reduce confusion with new cherrypy.tools. ↵Robert Brewer2006-06-121-121/+8
| | | | Moved non-Tool-related code from cptools to {{{lib/__init__}}}. Added docstrings.
* Separated tool construction from default toolbox by renaming cherrypy.tools ↵Robert Brewer2006-06-121-51/+1
| | | | 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.
* A little hook/tool refactoring. Moved HookMap from tools module to ↵Robert Brewer2006-06-031-9/+0
| | | | _cprequest, and consolidated toolmap and tool setup into a new Request.tool_up method.
* Fix for #531 (Make an ETag tool). Also refactored If-Modified-Since validation.Robert Brewer2006-06-031-1/+56
|
* Made tree.Application.script_name, and it now defaults to "", not "/".Robert Brewer2006-05-111-1/+1
|
* Dispatch and config lookup now happens as early as possible, once per ↵Robert Brewer2006-05-101-3/+6
| | | | request (unless InternalRedirect is raised). Also moved the logging code out of {{{_cputil}}} and into {{{__init__}}}. xmlrpc still needs fixed so it doesn't re-write path_info.
* Root and config are now isolated per app:Robert Brewer2006-05-071-4/+4
| | | | | | | | | | | 1. object_path is now called path_info, and there's a new request.script_name attribute. This should equal the mount point of the current application. 2. cherrypy.root is gone, use cherrypy.request.app.root for now instead. Perhaps cherrypy.root will reappear and point to that. 3. cherrypy.tree.mount_points has been replaced with cherrypy.tree.apps, a dict of the form {script_name: Application(root, conf)}. 4. The [global] config namespace is now contained in a flat cherrypy.config.globalconf dict. 5. Got rid of handling favicon.ico and the "*" URI (although they may return someday). 6. Upshot is that e.g. test_objectmapping.py takes 1/3 the time as CP 2.2. 7. Moved request body size check into _cprequest from _cpwsgi. 8. Fixed lib/wsgiapp and made a tool for it.
* Lots of changes to error and log handling:Robert Brewer2006-05-011-1/+12
| | | | | | | | | | | 1. Removed RequestHandled and InternalError. 2. Error response is now overridable by replacing request.error_response. Tools should do this in setup(). 3. New request.log_access attribute. 4. Moved response.handleError to request.handle_error. 5. Logging of tracebacks and request headers are now tools. 6. New ErrorRedirect tool class. 7. Tools may now be anonymous (not necessary to be placed in tools module globals). 8. Continued the move to lower_with_underscores.
* Removed a bunch of instances of the word "filter".Robert Brewer2006-04-251-3/+3
|
* test_core works again.Robert Brewer2006-04-251-2/+2
| | | | | | | 1. I'll look at replacing _cp_on_error with Tools some other day. 2. Moved the HookMap into tools.py. 3. New config.current_config function. 4. static.serve_file now sets body even if not modified_since.
* Fixed session auth for new tool API.Robert Brewer2006-04-251-71/+71
|
* Added a 'force' flag to response_headers tool.Robert Brewer2006-04-211-3/+3
|
* Corrected several old headerMap references. Updated ↵Robert Brewer2006-04-211-2/+2
| | | | test_response_headers_filter.py
* CP 3 initial checkin. Global filters have been replaced by request.hooks. ↵Robert Brewer2006-04-211-153/+140
| | | | Lots of renaming and reorg of modules.
* Added CallFunc and NoneType to unrepr. This allows object instantiation in ↵Robert Brewer2006-04-191-0/+7
| | | | config files.
* As per [http://tinyurl.com/l7axz the discussion] on cherrypy-devel,Christian Wyglendowski2006-03-161-0/+15
| | | | | | | | | | | the WSGIAppFilter is no longer configurable through the CP config system. You should either add an instance of cherrypy.filters.wsgiappfilter.WSGIAppFilter to your _cp_filters list or use the cherrypy.lib.cptools.WSGIApp convenience class. Also tweaked the test for wsgiappfilter to make sure that static content higher than a WSGI application on the tree gets served correctly.
* Fix for #458 (auto-init mimetypes module). Knownfiles only works on Unix.Robert Brewer2006-02-191-0/+1
|
* Fix for serveFile if the extension is uppercase (like "picture.JPG").Robert Brewer2006-01-231-1/+1
|
* created modified_since function so that applications can check manually if a ↵Sylvain Hellegouarch2006-01-201-10/+30
| | | | file has been modified since a given date
* Fix for #430 (serveFile should require abs paths).Robert Brewer2006-01-021-10/+6
|
* Fix for #404, #417 (index files and staticfilter). New "static_filter.index" ↵Robert Brewer2005-12-291-0/+4
| | | | config entry.
* Big change: camelCase to lower_with_underscore names (still need to update ↵Remi Delon2005-12-031-17/+17
| | | | the book)
* Got rid of some superfluous custom exceptions.Robert Brewer2005-11-261-4/+1
|
* Made response.body into a descriptor:Robert Brewer2005-11-261-4/+4
| | | | | | 1. Now *anytime* you set body it will coerce it to an iterable, so code outside Request.main doesn't have to be as careful/aware of how to do that. 2. New response.collapse_body() function, which collapses the body into a single new_body string, sets response.body to [new_body], and returns new_body. 3. New request.executeMain flag (bool), to govern whether Request.main method is called. This replaces the old behavior, where main would be called "if response.body is None". There may be custom beforeMain filters which depend on the old behavior, and need to be updated to set request.executeMain = False.
* Moved filter-handling code into lib.filter.__init__.py. Also moved unrepr ↵Robert Brewer2005-11-101-0/+108
| | | | and modules(), attributes() functions into cptools.
* Moved a bunch of stuff from lib/cptools into a new lib/httptools module. The ↵Robert Brewer2005-11-051-359/+7
| | | | new module does not reference cherrypy (and should never do so). Think of it as the httptools module Python should distribute. ;)
* Moved _cphttptools.KeyTitlingDict to lib.cptools.HeaderMap.Robert Brewer2005-11-011-0/+46
|
* Fix for #357 (Pythonic access to Accept-* request headers). New ↵Robert Brewer2005-11-011-0/+81
| | | | cptools.getAccept function, which returns a list of AcceptValue objects (sorted in descending priority). GzipFilter rewritten to use it.
* Moved these blocks out of _cphttptools.Request and into cptools: ↵Robert Brewer2005-10-311-1/+65
| | | | parseRequestLine, parseQueryString, paramsFromCGIForm. This should help filter authors and others re-use some of the nuts and bolts of CP.
* Fix for #374 (reduce license boilerplate to a single LICENSE.txt file).Robert Brewer2005-10-311-31/+1
|
* Fix for #356 (formalize server.environment as a set of config defaults). New ↵Robert Brewer2005-10-311-1/+1
| | | | server.logFileNotFound boolean.
* Fix for #373 (arbitrary mount points, or "virtual roots"). All internal use ↵Robert Brewer2005-10-291-1/+0
| | | | of request.path has been changed to inspect request.objectPath instead (the "rewritten path"). The request.path should never be rewritten; instead, it should only be used to generate new URL's based on the original path. The request.originalPath attribute can now probably be deprecated.
* Fix for #283.Robert Brewer2005-10-101-2/+2
|
* NotFound path arg now defaults to cherrypy.request.path.Robert Brewer2005-10-031-2/+2
|
* Fix for ticket #317? More importantly, some error-handling and other cleanups:Robert Brewer2005-09-271-1/+47
| | | | | | | | | | | 1. _cphttptools.checkStatus moved to lib.cptools.validStatus. Illegal status codes now raise HTTPError(500) with custom messages. 2. _cputil.responseCodes moved into cptools. 3. _cpOnError logic *all* moved into HTTPError.set_response. 4. _cputil.getErrorStatusAndPage changed to getErrorPage. 5. Made _cputil._HTTPErrorTemplate into a string instead of a function, which the new getErrorPage interpolates with its own **kwargs. 6. HTTPError now properly takes a "message" arg instead of a "body" arg. Specify alternate body via errorPage.4xx config entry (overriding _HTTPErrorTemplate). 7. HTTPError now allows str statuses, to allow arbitrary reason-phrases. 8. assertErrorPage in helper.py updated to match core changes.
* Closes #324 (wontfix). Added more extensive comment regarding relative paths ↵Robert Brewer2005-09-251-0/+7
| | | | for cptools.serveFile.
* Fix for #318, #322 and #323.Robert Brewer2005-09-251-33/+37
| | | | | | #318: streaming output is now off by default. This means you may now use "yield" without worrying about pre-determining the status and headers. To enable streaming output you must set the config entry "streamResponse" to True. You should probably also use "yield", since it doesn't make much sense to stream a single chunk. #322: HTTP/1.0 requests may now stream their output. #323: moved request.version to response.version. Also, made sure Range headers are not read or written unless response.version >= 1.1.
* ticket:288 changes merged into trunk, deleted httperrors branch, added ↵Michael Robinson2005-09-131-1/+1
| | | | assertErrorPage to CPWebCase
* HTTPClientError renamed HTTPStatusError, removed some outdated session ↵Michael Robinson2005-09-051-1/+1
| | | | documentation
* improvments to the http errors tutorial (10), minor cleanups of the http ↵Michael Robinson2005-09-041-2/+2
| | | | error code.
* Moved fileGenerator, httpdate, serve_file, and get_ranges from _cphttptools ↵Robert Brewer2005-08-301-1/+202
| | | | to cptools (now HTTPDate, serveFile, and getRanges). serveFile has new contentType, disposition, and name arguments, and now returns cherrypy.response.body.
* All raised exceptions now conform to "raise Exception([arg])" syntax (no ↵Robert Brewer2005-08-261-1/+1
| | | | more "raise Exception" or "raise Exception, arg". See http://mail.python.org/pipermail/python-dev/2005-August/055687.html for Guido's pronouncement, which is now part of PEP 8.
* 1. Partial fix for ticket #242 (ability to specify attributes in a config file).Robert Brewer2005-08-081-3/+3
| | | | | 2. Moved modules, attributes functions from server.py to _cputil.py. 3. A couple of newline fixes for unrelated modules.
* yet another fix to positionalparametersawarePeter Hunt2005-08-071-2/+5
|
* Removed windows line endings from revision 490.John P. Speno2005-07-211-5/+4
|
* fix to cptools that made index() work in corner cases, and fixed a security ↵Peter Hunt2005-07-201-4/+8
| | | | flaw.
* Fixes for ticket #226.Robert Brewer2005-07-141-4/+4
|
* Fix to cptools.PositionalParametersAware that broke NotFound functionality.Peter Hunt2005-07-121-1/+5
|