Back to index

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

Functions

def macro_Hits

Variables

list Dependencies = ['time']

Function Documentation

def MoinMoin.macro.Hits.macro_Hits (   macro,
  all = False,
  event_type = (u'VIEWPAGE', u'SAVEPAGE' 
)

Definition at line 22 of file Hits.py.

00022 
00023 def macro_Hits(macro, all=False, event_type=(u'VIEWPAGE', u'SAVEPAGE')):
00024     request = macro.request
00025     pagename = macro.formatter.page.page_name
00026 
00027     if all:
00028         cache_days, cache_views, cache_edits = hitcounts.get_data(pagename, request, filterpage=None)
00029     else:
00030         cache_days, cache_views, cache_edits = hitcounts.get_data(pagename, request, filterpage=pagename)
00031 
00032     if event_type == u'VIEWPAGE':
00033         return u'%d' % sum(cache_views)
00034     else:
00035         return u'%d' % sum(cache_edits)
00036 

Variable Documentation

Definition at line 18 of file Hits.py.