Back to index

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

List of all members.

Public Member Functions

def __contains__
def __iter__
def __getitem__
def is_group_name
def __repr__
def groups_with_member
def get

Public Attributes

 request
 page_group_regex

Private Member Functions

def _retrieve_members

Detailed Description

Definition at line 60 of file wiki_groups.py.


Member Function Documentation

Check if a group called <group_name> is available in this backend.

Reimplemented from MoinMoin.datastruct.backends.BaseGroupsBackend.

Definition at line 62 of file wiki_groups.py.

00062 
00063     def __contains__(self, group_name):
00064         return self.is_group_name(group_name) and Page(self.request, group_name).exists()

Here is the call graph for this function:

Get a group by its moin group name.

Reimplemented from MoinMoin.datastruct.backends.BaseGroupsBackend.

Definition at line 71 of file wiki_groups.py.

00071 
00072     def __getitem__(self, group_name):
00073         return WikiGroup(request=self.request, name=group_name, backend=self)

Here is the caller graph for this function:

To find group pages, request.cfg.cache.page_group_regexact pattern is used.

Reimplemented from MoinMoin.datastruct.backends.BaseGroupsBackend.

Definition at line 65 of file wiki_groups.py.

00065 
00066     def __iter__(self):
00067         """
00068         To find group pages, request.cfg.cache.page_group_regexact pattern is used.
00069         """
00070         return iter(self.request.rootpage.getPageList(user='', filter=self.page_group_regex.search))

Reimplemented in MoinMoin.datastruct.backends.composite_groups.CompositeGroups.

Definition at line 82 of file __init__.py.

00082 
00083     def __repr__(self):
00084         return "<%s groups=%s>" % (self.__class__, list(self))

MoinMoin.formatter.groups is used to extract group members from a page.

Reimplemented from MoinMoin.datastruct.backends.BaseGroupsBackend.

Definition at line 74 of file wiki_groups.py.

00074 
00075     def _retrieve_members(self, group_name):
00076         """
00077         MoinMoin.formatter.groups is used to extract group members from a page.
00078         """
00079         formatter = Formatter(self.request)
00080         page = Page(self.request, group_name, formatter=formatter)
00081 
00082         request_page = getattr(self.request, "page", None)
00083         self.request.page = page
00084         # send_special is set to True because acl of the page should
00085         # not be processed to avoid infinite recursion in the
00086         # following case.
00087         #
00088         # Consider page UserGroup content:
00089         #
00090         # #acl UserGroup:read,write,admin All:read
00091         #
00092         #  * ExampleUser
00093         #  * TestGroup
00094         #
00095         page.send_page(content_only=True, send_special=True)
00096 
00097         if request_page:
00098             self.request.page = request_page
00099         else:
00100             del self.request.page
00101 
00102         return formatter.members
00103 
def MoinMoin.datastruct.backends.BaseGroupsBackend.get (   self,
  key,
  default = None 
) [inherited]
Return the group 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 GroupDoesNotExistError.

Definition at line 102 of file __init__.py.

00102 
00103     def get(self, key, default=None):
00104         """
00105         Return the group named <key> if key is in the backend, else
00106         default. If default is not given, it defaults to None, so that
00107         this method never raises a GroupDoesNotExistError.
00108         """
00109         try:
00110             return self[key]
00111         except GroupDoesNotExistError:
00112             return default
00113 

Here is the caller graph for this function:

List all group names of groups containing <member>.

@param member: member name [unicode]
@return: list of group names [unicode]

Definition at line 88 of file __init__.py.

00088 
00089     def groups_with_member(self, member):
00090         """
00091         List all group names of groups containing <member>.
00092 
00093         @param member: member name [unicode]
00094         @return: list of group names [unicode]
00095         """
00096         for group_name in self:
00097             try:
00098                 if member in self[group_name]:
00099                     yield group_name
00100             except GroupDoesNotExistError:
00101                 pass

def MoinMoin.datastruct.backends.BaseGroupsBackend.is_group_name (   self,
  member 
) [inherited]

Definition at line 59 of file __init__.py.

00059 
00060     def is_group_name(self, member):
00061         return self.page_group_regex.match(member)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 57 of file __init__.py.

Definition at line 56 of file __init__.py.


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