Back to index

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

List of all members.

Public Member Functions

def __init__
def __iter__
def __call__
def __getattr__
def __setattr__
def __delattr__

Static Private Attributes

tuple __slots__ = ('__storage__', '__lock__')

Detailed Description

Definition at line 94 of file local.py.


Constructor & Destructor Documentation

Definition at line 97 of file local.py.

00097 
00098     def __init__(self):
00099         object.__setattr__(self, '__storage__', {})
00100         object.__setattr__(self, '__lock__', allocate_lock())


Member Function Documentation

Create a proxy for a name.

Definition at line 104 of file local.py.

00104 
00105     def __call__(self, proxy):
00106         """Create a proxy for a name."""
00107         return LocalProxy(self, proxy)

Definition at line 130 of file local.py.

00130 
00131     def __delattr__(self, name):
00132         self.__lock__.acquire()
00133         try:
00134             try:
00135                 del self.__storage__[get_ident()][name]
00136             except KeyError:
00137                 raise AttributeError(name)
00138         finally:
00139             self.__lock__.release()
00140 

Definition at line 108 of file local.py.

00108 
00109     def __getattr__(self, name):
00110         self.__lock__.acquire()
00111         try:
00112             try:
00113                 return self.__storage__[get_ident()][name]
00114             except KeyError:
00115                 raise AttributeError(name)
00116         finally:
00117             self.__lock__.release()

Definition at line 101 of file local.py.

00101 
00102     def __iter__(self):
00103         return self.__storage__.iteritems()

def MoinMoin.support.werkzeug.local.Local.__setattr__ (   self,
  name,
  value 
)

Definition at line 118 of file local.py.

00118 
00119     def __setattr__(self, name, value):
00120         self.__lock__.acquire()
00121         try:
00122             ident = get_ident()
00123             storage = self.__storage__
00124             if ident in storage:
00125                 storage[ident][name] = value
00126             else:
00127                 storage[ident] = {name: value}
00128         finally:
00129             self.__lock__.release()


Member Data Documentation

tuple MoinMoin.support.werkzeug.local.Local.__slots__ = ('__storage__', '__lock__') [static, private]

Definition at line 95 of file local.py.


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