Back to index

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

Functions

def macro_PageCount

Variables

list Dependencies = ['namespace']

Function Documentation

def MoinMoin.macro.PageCount.macro_PageCount (   macro,
  exists = None 
)
Return number of pages readable by current user

Return either an exact count (slow!) or fast count including deleted pages.

TODO: make macro syntax more sane

Definition at line 13 of file PageCount.py.

00013 
00014 def macro_PageCount(macro, exists=None):
00015     """ Return number of pages readable by current user
00016 
00017     Return either an exact count (slow!) or fast count including deleted pages.
00018 
00019     TODO: make macro syntax more sane
00020     """
00021     request = macro.request
00022     exists = wikiutil.get_unicode(request, exists, 'exists')
00023     # Check input
00024     only_existing = False
00025     if exists == u'exists':
00026         only_existing = True
00027     elif exists:
00028         raise ValueError("Wrong argument: %r" % exists)
00029 
00030     count = request.rootpage.getPageCount(exists=only_existing)
00031     return macro.formatter.text("%d" % count)
00032 

Variable Documentation

Definition at line 9 of file PageCount.py.