Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Attributes
MoinMoin.web.contexts.Context Class Reference
Inheritance diagram for MoinMoin.web.contexts.Context:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def become
def __repr__

Public Attributes

 request
 environ
 personalities

Private Attributes

 __class__

Detailed Description

Standard implementation for the context interface.

This one wraps up a Moin-Request object and the associated
environ and also keeps track of it's changes.

Definition at line 71 of file contexts.py.


Constructor & Destructor Documentation

def MoinMoin.web.contexts.Context.__init__ (   self,
  request 
)

Definition at line 77 of file contexts.py.

00077 
00078     def __init__(self, request):
00079         assert isinstance(request, Request)
00080 
00081         self.request = request
00082         self.environ = environ = request.environ
00083         self.personalities = self.environ.setdefault(
00084             'context.personalities', []
00085         )
00086         self.personalities.append(self.__class__.__name__)


Member Function Documentation

Definition at line 101 of file contexts.py.

00101 
00102     def __repr__(self):
00103         return "<%s %r>" % (self.__class__.__name__, self.personalities)

def MoinMoin.web.contexts.Context.become (   self,
  cls 
)
Become another context, based on given class.

@param cls: class to change to, must be a sister class
@rtype: boolean
@return: wether a class change took place

Definition at line 87 of file contexts.py.

00087 
00088     def become(self, cls):
00089         """ Become another context, based on given class.
00090 
00091         @param cls: class to change to, must be a sister class
00092         @rtype: boolean
00093         @return: wether a class change took place
00094         """
00095         if self.__class__ is cls:
00096             return False
00097         else:
00098             self.personalities.append(cls)
00099             self.__class__ = cls
00100             return True


Member Data Documentation

Definition at line 98 of file contexts.py.

Definition at line 81 of file contexts.py.

Definition at line 82 of file contexts.py.

Definition at line 80 of file contexts.py.


The documentation for this class was generated from the following file: