changeset 4187:c659fd8d792d

API descriptions for new interfaces and services
author Florian Krupicka <florian.krupicka@googlemail.com>
date Tue, 24 Jun 2008 23:54:44 +0200
parents 126559845d4b
children a2709307da3d
files MoinMoin/web/api.py
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/web/api.py	Tue Jun 24 23:54:44 2008 +0200
@@ -0,0 +1,38 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - Interface definitions
+
+    Interface definitions for the Request object and associated classes
+    and services.
+
+    @copyright: 2008 MoinMoin:FlorianKrupicka
+    @license: GNU GPL, see COPYING for details.
+"""
+
+class Interface(object):
+    """ An interface (marker class) """
+
+class IContext(Interface):
+    """
+    A context object represents the request in different phases of the
+    request/response cycle, e.g. session setup, page renderin (formatter
+    or parser), XML-RPC, etc.
+    """
+    def become(cls):
+        """ Become another context, based on the given class. """
+
+
+class ISessionService(Interface):
+    """
+    A session service returns a session object given a request object and
+    provides services like persisting sessions and cleaning up occasionally.
+    """
+    def get_session(request):
+        """ Return a session object pertaining to the particular request."""
+
+    def finalize(request, session):
+        """
+        Do final modifications to the request and/or session before sending
+        headers and body to the cliebt.
+        """
+