Changes for Developers (WSGI related)

In the course of cleaning up the request code base of MoinMoin and making it consistent with the new WSGI interface, some major changes have been introduced. The code now depends on werkzeug, a WSGI library, that abstracts a lot of the low level code of web applications.

Moved and deleted code

The packages of MoinMoin.request and MoinMoin.server` have both been integrated into a single package MoinMoin.web and then removed.

Request

The request object in MoinMoin.web.request does not play the same role as the request-objects earlier in MoinMoin. It is a combination of werkzeug.Request and werkzeug.Response, therefore it serves as an abstraction over incoming data from the browser as well as a way to output to the browser.

To avoid ambigious property-names in werkzeug's request/response classes, some properties deviate from the documentation. They are present in both, Request and Response from werkzeug. Therefore the properties stemming from Request are prefixed with in_ to denote their origin as incoming data. The following properties of werkzeug.Request are currently prefixed:

Contexts

Many of the responsibilities of the former Request objects of MoinMoin are now transfered to the newly created notion of a Context object. They provide access to higher level logic like essential properties (cfg, page, getText, etc.) or utility methods like theme initialization or redirected output. Also some compatibility methods from the old Request-API have been ported here. You can see MoinMoin/web/contexts.py for more information on which methods are available.

Contexts are merely wrappers around MoinMoin.web.request.Request objects and should not depend on internal state. Properties are proxied into the environ- dictionary of the wrapped request-objects as are accesses to the low level request methods.

MoinMoin: NewDocs/DeveloperChanges (last edited 2008-08-26 21:35:57 by FlorianKrupicka)