Mercurial > moin > 1.9
changeset 4317:371bf2615ea1
Code review: added some more documentation
author | Florian Krupicka <florian.krupicka@googlemail.com> |
---|---|
date | Sun, 17 Aug 2008 23:56:59 +0200 |
parents | 37882d4d7a2f |
children | 71af4f379631 |
files | MoinMoin/web/session.py |
diffstat | 1 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/web/session.py Sun Aug 17 23:40:09 2008 +0200 +++ b/MoinMoin/web/session.py Sun Aug 17 23:56:59 2008 +0200 @@ -2,7 +2,10 @@ """ MoinMoin - WSGI session handling - Session handling + To provide sessions, the MoinMoin WSGI application interacts with an + object implementing the `SessionService` API. The interface is quite + straight forward. For documentation of the expected methods, refer + to the documentation of `SessionService` in this module. @copyright: 2008 MoinMoin:FlorianKrupicka @license: GNU GPL, see COPYING for details. @@ -37,18 +40,20 @@ def finalize(self, request, session): """ - Do final modifications to the request and/or session before sending - headers and body to the cliebt. + If the service needs to do anything to the session and/or request, + before it is sent back to the client, he can chose to do so here. + Typical examples would be setting cookies for the client. """ raise NotImplementedError class FileSessionService(SessionService): """ This sample session service stores session information in a temporary - directory and identifis the session via a cookie in the request/response - cycle. + directory and identifies the session via a cookie in the request/response + cycle. It is based on werkzeug's FilesystemSessionStore, that implements + the whole logic for creating the actual session objects (which are + inherited from the builtin `dict`) """ - def __init__(self, cookie_name='MOIN_SESSION'): self.store = FilesystemSessionStore(session_class=MoinSession) self.cookie_name = cookie_name