Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
MoinMoin.support.werkzeug._internal._DictAccessorProperty Class Reference

List of all members.

Public Member Functions

def __init__
def __get__
def __set__
def __delete__
def __repr__

Public Attributes

 name
 default
 load_func
 dump_func

Static Public Attributes

 read_only = False

Private Attributes

 __doc__

Detailed Description

Baseclass for `environ_property` and `header_property`.

Definition at line 287 of file _internal.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug._internal._DictAccessorProperty.__init__ (   self,
  name,
  default = None,
  load_func = None,
  dump_func = None,
  read_only = None,
  doc = None 
)

Definition at line 292 of file _internal.py.

00292 
00293                  read_only=None, doc=None):
00294         self.name = name
00295         self.default = default
00296         self.load_func = load_func
00297         self.dump_func = dump_func
00298         if read_only is not None:
00299             self.read_only = read_only
00300         self.__doc__ = doc


Member Function Documentation

Definition at line 322 of file _internal.py.

00322 
00323     def __delete__(self, obj):
00324         if self.read_only:
00325             raise AttributeError('read only property')
00326         self.lookup(obj).pop(self.name, None)

Here is the call graph for this function:

def MoinMoin.support.werkzeug._internal._DictAccessorProperty.__get__ (   self,
  obj,
  type = None 
)

Definition at line 301 of file _internal.py.

00301 
00302     def __get__(self, obj, type=None):
00303         if obj is None:
00304             return self
00305         storage = self.lookup(obj)
00306         if self.name not in storage:
00307             return self.default
00308         rv = storage[self.name]
00309         if self.load_func is not None:
00310             try:
00311                 rv = self.load_func(rv)
00312             except (ValueError, TypeError):
00313                 rv = self.default
00314         return rv

Here is the call graph for this function:

Definition at line 327 of file _internal.py.

00327 
00328     def __repr__(self):
00329         return '<%s %s>' % (
00330             self.__class__.__name__,
00331             self.name
00332         )
00333 

Definition at line 315 of file _internal.py.

00315 
00316     def __set__(self, obj, value):
00317         if self.read_only:
00318             raise AttributeError('read only property')
00319         if self.dump_func is not None:
00320             value = self.dump_func(value)
00321         self.lookup(obj)[self.name] = value

Here is the call graph for this function:


Member Data Documentation

Definition at line 299 of file _internal.py.

Definition at line 294 of file _internal.py.

Definition at line 296 of file _internal.py.

Definition at line 295 of file _internal.py.

Definition at line 293 of file _internal.py.

Definition at line 289 of file _internal.py.


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