Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.macro.Navigation Namespace Reference

Classes

class  Navigation

Functions

def _getParent
def _getPages
def _getLinks
def macro_Navigation

Variables

list Dependencies = ["namespace"]

Function Documentation

def MoinMoin.macro.Navigation._getLinks (   request,
  pagename,
  filter_regex = None 
) [private]
Return pagename for up, first, prev, next, last; each can be None.

Definition at line 38 of file Navigation.py.

00038 
00039 def _getLinks(request, pagename, filter_regex=None):
00040     """ Return pagename for up, first, prev, next, last; each can be None.
00041     """
00042     pos, first, prev, next, last = 0, None, None, None, None
00043 
00044     all_pages = _getPages(request, filter_regex)
00045     size = len(all_pages)
00046 
00047     if all_pages:
00048         try:
00049             pos = all_pages.index(pagename)
00050         except ValueError:
00051             # this should never happen in theory, but let's be sure
00052             pass
00053         else:
00054             if pos > 0:
00055                 first = all_pages[0]
00056                 prev = all_pages[pos-1]
00057             if pos+1 < len(all_pages):
00058                 next = all_pages[pos+1]
00059                 last = all_pages[-1]
00060 
00061     return pos, size, (first, prev, next, last)
00062 

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.macro.Navigation._getPages (   request,
  filter_regex = None 
) [private]
Return a (filtered) list of pages names.

Definition at line 27 of file Navigation.py.

00027 
00028 def _getPages(request, filter_regex=None):
00029     """ Return a (filtered) list of pages names.
00030     """
00031     filterfn = None
00032     if filter_regex:
00033         filterfn = re.compile(filter_regex).match
00034     pages = request.rootpage.getPageList(filter=filterfn)
00035     pages.sort()
00036     return pages
00037 

Here is the caller graph for this function:

def MoinMoin.macro.Navigation._getParent (   pagename) [private]
Return parent of pagename.

Definition at line 18 of file Navigation.py.

00018 
00019 def _getParent(pagename):
00020     """ Return parent of pagename.
00021     """
00022     pos = pagename.rfind('/')
00023     if pos >= 0:
00024         return pagename[:pos]
00025     return None
00026 

Here is the caller graph for this function:

def MoinMoin.macro.Navigation.macro_Navigation (   macro,
  scheme = wikiutil.required_arg((u'children', u'siblings',                                                   u'slideshow',
  u,
  slides,
  depth = 0 
)

Definition at line 223 of file Navigation.py.

00223 
00224                     depth=0):
00225     # get HTML code with the links
00226     navi = Navigation(macro, scheme, depth).dispatch()
00227 
00228     if navi:
00229         # return links packed into a table
00230         return u'<table class="navigation"><tr><td>%s</td></tr></table>' % navi
00231 
00232     # navigation disabled in plain print mode
00233     return u''
00234 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 14 of file Navigation.py.