Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
MoinMoin.datastruct.backends.BaseDict Class Reference
Inheritance diagram for MoinMoin.datastruct.backends.BaseDict:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.datastruct.backends.BaseDict:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __iter__
def keys
def __len__
def __getitem__
def get
def __repr__

Public Attributes

 request
 name

Private Member Functions

def _load_dict

Private Attributes

 _backend
 _dict

Detailed Description

Definition at line 259 of file __init__.py.


Constructor & Destructor Documentation

def MoinMoin.datastruct.backends.BaseDict.__init__ (   self,
  request,
  name,
  backend 
)
Initialize a dict. Dicts are greedy, it stores all keys and
items internally.

@param request
@param name: moin dict name
@backend: backend object which created this object

Definition at line 261 of file __init__.py.

00261 
00262     def __init__(self, request, name, backend):
00263         """
00264         Initialize a dict. Dicts are greedy, it stores all keys and
00265         items internally.
00266 
00267         @param request
00268         @param name: moin dict name
00269         @backend: backend object which created this object
00270         """
00271         self.request = request
00272         self.name = name
00273         self._backend = backend
00274         self._dict = self._load_dict()


Member Function Documentation

Definition at line 284 of file __init__.py.

00284 
00285     def __getitem__(self, key):
00286         return self._dict[key]

Here is the caller graph for this function:

Definition at line 275 of file __init__.py.

00275 
00276     def __iter__(self):
00277         return self._dict.__iter__()

Definition at line 281 of file __init__.py.

00281 
00282     def __len__(self):
00283         return self._dict.__len__()

Definition at line 301 of file __init__.py.

00301 
00302     def __repr__(self):
00303         return "<%r name=%r items=%r>" % (self.__class__, self.name, self._dict.items())
00304 

Retrieve dict data from the backend.

Reimplemented in MoinMoin.datastruct.backends.wiki_dicts.WikiDict.

Definition at line 295 of file __init__.py.

00295 
00296     def _load_dict(self):
00297         """
00298         Retrieve dict data from the backend.
00299         """
00300         return self._backend._retrieve_items(self.name)

def MoinMoin.datastruct.backends.BaseDict.get (   self,
  key,
  default = None 
)
Return the value if key is in the dictionary, else default. If
default is not given, it defaults to None, so that this method
never raises a KeyError.

Definition at line 287 of file __init__.py.

00287 
00288     def get(self, key, default=None):
00289         """
00290         Return the value if key is in the dictionary, else default. If
00291         default is not given, it defaults to None, so that this method
00292         never raises a KeyError.
00293         """
00294         return self._dict.get(key, default)

Here is the caller graph for this function:

Definition at line 278 of file __init__.py.

00278 
00279     def keys(self):
00280         return list(self)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 272 of file __init__.py.

Definition at line 273 of file __init__.py.

Definition at line 271 of file __init__.py.

Definition at line 270 of file __init__.py.


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