Back to index

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

List of all members.

Public Member Functions

def __contains__
def __getitem__
def is_dict_name
def get

Public Attributes

 request
 page_dict_regex

Private Member Functions

def _retrieve_items

Static Private Attributes

tuple _dict_page_parse_regex = re.compile(ur'^ (?P<key>.+?):: (?P<val>.*?) *$', re.MULTILINE | re.UNICODE)

Detailed Description

Definition at line 64 of file wiki_dicts.py.


Member Function Documentation

Check if a dict called <dict_name> is available in this backend.

Reimplemented from MoinMoin.datastruct.backends.BaseDictsBackend.

Definition at line 69 of file wiki_dicts.py.

00069 
00070     def __contains__(self, dict_name):
00071         return self.is_dict_name(dict_name) and Page(self.request, dict_name).exists()

Here is the call graph for this function:

Get a dict by its moin dict name.

Reimplemented from MoinMoin.datastruct.backends.BaseDictsBackend.

Definition at line 72 of file wiki_dicts.py.

00072 
00073     def __getitem__(self, dict_name):
00074         return WikiDict(request=self.request, name=dict_name, backend=self)

Here is the caller graph for this function:

def MoinMoin.datastruct.backends.wiki_dicts.WikiDicts._retrieve_items (   self,
  dict_name 
) [private]

Reimplemented from MoinMoin.datastruct.backends.BaseDictsBackend.

Definition at line 75 of file wiki_dicts.py.

00075 
00076     def _retrieve_items(self, dict_name):
00077         # XXX in Moin 2.0 regex should not be used instead use DOM
00078         # tree to extract dict values. Also it should be possible to
00079         # convert dict values to different markups (wiki-markup,
00080         # creole...).
00081         #
00082         # Note that formatter which extracts dictionary from a
00083         # page was developed. See
00084         # http://hg.moinmo.in/moin/1.9-groups-dmilajevs/file/982f706482e7/MoinMoin/formatter/dicts.py
00085         page = Page(self.request, dict_name)
00086         text = page.get_raw_body()
00087         return dict([match.groups() for match in self._dict_page_parse_regex.finditer(text)])
00088 
def MoinMoin.datastruct.backends.BaseDictsBackend.get (   self,
  key,
  default = None 
) [inherited]
Return the dictionary named <key> if key is in the backend,
else default. If default is not given, it defaults to None, so
that this method never raises a DictDoesNotExistError.

Definition at line 329 of file __init__.py.

00329 
00330     def get(self, key, default=None):
00331         """
00332         Return the dictionary named <key> if key is in the backend,
00333         else default. If default is not given, it defaults to None, so
00334         that this method never raises a DictDoesNotExistError.
00335         """
00336         try:
00337             return self[key]
00338         except DictDoesNotExistError:
00339             return default
00340 

Here is the caller graph for this function:

def MoinMoin.datastruct.backends.BaseDictsBackend.is_dict_name (   self,
  name 
) [inherited]

Definition at line 311 of file __init__.py.

00311 
00312     def is_dict_name(self, name):
00313         return self.page_dict_regex.match(name)

Here is the caller graph for this function:


Member Data Documentation

tuple MoinMoin.datastruct.backends.wiki_dicts.WikiDicts._dict_page_parse_regex = re.compile(ur'^ (?P<key>.+?):: (?P<val>.*?) *$', re.MULTILINE | re.UNICODE) [static, private]

Definition at line 67 of file wiki_dicts.py.

Definition at line 309 of file __init__.py.

Definition at line 308 of file __init__.py.


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