Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.action.LocalSiteMap.PageTreeBuilder Class Reference

List of all members.

Public Member Functions

def __init__
def mark_child
def child_marked
def is_ok
def new_kids
def new_node
def build_tree
def recurse_build

Public Attributes

 request
 children
 numnodes
 maxnodes

Detailed Description

Definition at line 84 of file LocalSiteMap.py.


Constructor & Destructor Documentation

Definition at line 85 of file LocalSiteMap.py.

00085 
00086     def __init__(self, request):
00087         self.request = request
00088         self.children = {}
00089         self.numnodes = 0
00090         self.maxnodes = 35


Member Function Documentation

Definition at line 119 of file LocalSiteMap.py.

00119 
00120     def build_tree(self, name):
00121         self.mark_child(name)
00122         tree = Tree(name)
00123         try:
00124             self.recurse_build([tree], 1)
00125         except MaxNodesReachedException:
00126             pass
00127         return tree

Here is the call graph for this function:

Definition at line 94 of file LocalSiteMap.py.

00094 
00095     def child_marked(self, name):
00096         return name in self.children

Here is the caller graph for this function:

Definition at line 97 of file LocalSiteMap.py.

00097 
00098     def is_ok(self, child):
00099         if not self.child_marked(child):
00100             if not self.request.user.may.read(child):
00101                 return 0
00102             if Page(self.request, child).exists():
00103                 self.mark_child(child)
00104                 return 1
00105         return 0

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 91 of file LocalSiteMap.py.

00091 
00092     def mark_child(self, name):
00093         self.children[name] = 1

Here is the caller graph for this function:

Definition at line 106 of file LocalSiteMap.py.

00106 
00107     def new_kids(self, name):
00108         # does not recurse
00109         kids = []
00110         for child in Page(self.request, name).getPageLinks(self.request):
00111             if self.is_ok(child):
00112                 kids.append(child)
00113         return kids

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file LocalSiteMap.py.

00114 
00115     def new_node(self):
00116         self.numnodes = self.numnodes + 1
00117         if self.numnodes == self.maxnodes:
00118             raise MaxNodesReachedException

Here is the caller graph for this function:

def MoinMoin.action.LocalSiteMap.PageTreeBuilder.recurse_build (   self,
  trees,
  depth 
)

Definition at line 128 of file LocalSiteMap.py.

00128 
00129     def recurse_build(self, trees, depth):
00130         all_kids = []
00131         for tree in trees:
00132             kids = self.new_kids(tree.node)
00133             for kid in kids:
00134                 newTree = Tree(kid)
00135                 tree.append(newTree)
00136                 self.new_node()
00137                 all_kids.append(newTree)
00138         if len(all_kids):
00139             self.recurse_build(all_kids, depth+1)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 87 of file LocalSiteMap.py.

Definition at line 89 of file LocalSiteMap.py.

Definition at line 88 of file LocalSiteMap.py.

Definition at line 86 of file LocalSiteMap.py.


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