Package: pesto
Pesto is no longer actively maintained. Please check out its successor project,fresco,
instead.Pesto is a library for Python web applications. Its aim is to make writing WSGI
web applications easy and fun. Pesto doesn’t constrain you – how you integrate
with databases, what templating system you use or how you prefer to lay out
your source files is up to you. Above all, pesto is small, well documented and
well tested.Pesto makes it easy to:Map any URI to any part of your application.Produce unicode aware, standards compliant WSGI applications.Interrogate WSGI request information – form variables and HTTP request
headers.Create and manipulate HTTP headers, redirects, cookies etc.Integrate with any other WSGI application or middleware, giving you
access to a vast and growing resource.Development statusPesto is production ready and used on a wide variety of websites.To browse or check out the latest development version, visithttp://patch-tag.com/repo/pesto. For documentation, visithttp://pesto.redgecko.org/.LicencePesto is available under the terms of thenew BSD licence.DocumentationFull documentation is included with each release. Documentation for the latest
version is available at <http://pesto.redgecko.org/>.Version 25Fixed bug in pesto.utils.MultiDict and added a MultiDict.extend methodVersion 24Bugfixes for pesto.utils.MultiDict and pesto.dispatchpesto.utils.with_request_args decorator handles malformed input more gracefullyVersion 23Fix for exc_info handlingVersion 22Partial Python 2.4 backwards compatibility (thanks to Brian Peiris).Improvements to the handling of close methods on content iteratorsOther minor bugfixesVersion 21HEAD requests are passed to the GET handler if no explicit HEAD handler is
set up.DispatcherApp can now take aprefixargument that is prepended to all
match patternsNow uses the repoze.lru LRU cache implementation.Version 20Fixed RuntimeError when used under mod_wsgi (thanks to Mateusz Korniak)Fixed error parsing information out of user-agent cookie headers (thanks to
Mateusz Korniak)Version 19pesto.wsgiutils.serve_static_file now correctly sets the Last-Modified
header (thanks to Samuel Wan)Better compliance with HTTP RFC and WSGI spec on 204 No Content and 304 Not
Modified responsesRestored Python 2.5 compatibilityVersion 18PestoWSGIApplication/to_wsgi may now be used to decorate class methods as
well as regular functionsMinor bugfixesVersion 17pesto.util.MultiDict now retains insertion order of keys. This is useful
for form processing where you want to know the order in which fields are
submitted.Fixed bugs relating to path handling functions stripping trailing slashes
eg inpesto.wsgiutils.make_absolute_url. Alsopesto.dispatch.dispatcher_appno longer strips trailing slashes either,
it left to the application to do this if desired.Version 16Fixed error introduced into session handling, where the session cookie was
not resent if an old session disappearedVersion 15Corrected package version numberIncluded fixes for session handling (thanks to Ferry Pierre).Version 14FileSessionManager now saves files under dedicated _pesto_sessions
subdirectory, making it safer to use when initialized on a shared temporary
directory.Corrected pesto.wsgiutils.mount_app, which previously passed a reference to
an out of date request object to sub appsAltered the url() function acquired by dispatcher_app decorated functions
to allow script_name, netloc and URL scheme to be specified, making it
possible for multiple Pesto dispatcher_apps mounted at different paths or
network locations to generate valid URLs for each other.pesto.wsgiutils.with_request_args now raises error objects that may be
more easily separated out from other errors in middleware layers if required.Session.save() now forces a save even if no changes have been
detected (which may happen if you store mutable objects in the session)pesto.wsgiutils.with_request_args now raises exceptions generated
when parsing arguments from request data. This behaviour is generally more
useful to developers than an error page with no information about what
parameter is missing.Version 13Added HttpOnly option to cookiesSession middleware can now have the cookie path and domain overriddenVersion 12Added a path_info argument to request.make_uriImproved support for dispatcher_app to dispatch to bound methodsAdded many missing docstrings and other pylint/cheesecake suggested changesExtended request.make_uri to take any query argument that
wsgiutils.make_query will acceptmake_query now supports taking a list of (name, value) tuplesVersion 11Removed dbm and rdbms session managers, these were untested, undocumented and
were not recommended for use.Added fix for parse_querystring when qs is emptyFixed error on non-UTF8 encoded request bodyAdded X-Pesto-Exception header to help debugging of webappsImproved dispatch debug loggingFixed issue when using dispatcher predicates and cachingReversed dispatcher function matching precedence: the first matching function
winsRemove pesto.wsgiutils.MockWSGI and replace with classes in a new
pesto.testing moduleAdded a decorators argument to dispatcher_app.match, allowing handler
functions to have decorators which are only applied in the context of web
requestsRequest.cookies is now a MultiDict object with the same API as Request.form,
Request.files and Request.queryRenamed urldispatcher to dispatcher_app to clarify intent of this class.Made response.Response normalize header case and sort headers on ingress,
fixing a few consistency issues.Adjusted response header handling to be standards compliant on 304 responses
and ETag headersUse wsgiref.validator in MockWSGIRefactored some parts of request.py and wsgiutils.py into new httputils.py
and utils.py modules.Removed dependency on stdlib cgi.py (seehttp://mail.python.org/pipermail/web-sig/2009-May/003822.htmlfor reasons).Changed variables named ‘encoding’ to ‘charset’ to make the naming more
consistent with HTTP.Removed support for Python 2.3. From now on pesto is actively tested on 2.5
and 2.6, and I will try to support 2.4 if bugs are reported.Version 10Fixes in documentation and packaging, but no changes to functionalityVersion 9Added a predicate argument to dispatcher.match, allowing for extra arbitrary
checks before routing a URL.Add basic ETag supportRemoved http exceptionsAdded support for wsigorg.routing_argsWSGI apps created with pesto now have execution deferred until the first
iteration. Therefore the iterator’s .close method can be used to reliably
release resources etc.Fix for Response objects not catching close methods on upstream content
iteratorsAdded onclose kwarg for Response object. Any functions in onclose will be
called on the wsgi close event.Added request.files object to complement request.form and request.queryAdded MultiDict object to replace FieldStorageWrapperRenamed register_pattern to register_converter for consistencyAllowed multiple close functions to be passed to ClosingIteratorrequest.make_uri now uri quotes pathsRewrote urldispatcher to use a much more flexible URL matching syntaxRefactored Request initialisation to ensure that multiple calls don’t
attempt to reinitialize request parametersadded Response.getheaders, Response.getheader and Response.from_wsgiadd an ExtensiblePattern to dispatcher and enable it by defaultChanged dispatcher to be a WSGI callableAdded wsgiutils.ClosingIterator and wsgiutils.overlayPesto response objects are now valid WSGI appsEnsure the same Request instance is returned when called multiple times on
the same environ objectAdded a function for mapping request form parameters to function argumentsUpdated documentation: now requires sphinx for building docsRenamed WSGIRequest to Request for consistency with ResponseChanged ‘despatcher’ to ‘dispatcher’ throughout, after it was pointed out
that no one spells it this way any moreVersion 8Merged pesto.utils with pesto.wsgiutilsRefactored builtin static server to allow it to be used to serve ad-hoc
single filesAdded a make_query utility function to wsgiutilsFixed request.make_uri when presented with a relative URI. expanded the
docstring and tests.Static server fixes for windows environmentsVersion 7Reimplemented session saving machinery using the WSGI standard close()
mechanism.Request.FieldStorageWrapper now raises a KeyError on non-existant item accessVersion 6Added uri_join and fixed request.make_uri path concatenation logicMoved debug param out of despatch class and into despatcher_app, where it can
be applied across all despatchers in operationRemoved duplicate default charset/encoding settingAdded Response.bad_request() classmethodAdded Response.buffered methodAdded Response.add_cookieVersion 5Changed wsgiutils.make_absolute_url to bring into line with PEP 333 and
improve handling of relative URIsAdded Response.redirect, Response.not_found etc classmethods, replacing
previous freestanding functionsmake_query now allows a separator character to be specifiedpesto.currentrequest() returns None when no request availableAdd WSGIRequest.query to model querystring data. Both WSGIRequest.form and
.query are now properties and lazily instantiated.Version 4First publicly released version!