comparison MoinMoin/macro/Hits.py @ 2286:01f05e74aa9c

Big PEP8 and whitespace cleanup
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 02 Jul 2007 23:33:20 +0200
parents 9bea36ddd065
children adf5ec4874ed
comparison
equal deleted inserted replaced
2285:751e149a9a0a 2286:01f05e74aa9c
7 7
8 [[Hits([all=(0,1)],[filter=(VIEWPAGE,SAVEPAGE)]] 8 [[Hits([all=(0,1)],[filter=(VIEWPAGE,SAVEPAGE)]]
9 9
10 all: if set to 1 then cummulative hits over all wiki pages is returned. Default is 0 10 all: if set to 1 then cummulative hits over all wiki pages is returned. Default is 0
11 filter: if set to SAVEPAGE then the saved pages are counted. Default is VIEWPAGE. 11 filter: if set to SAVEPAGE then the saved pages are counted. Default is VIEWPAGE.
12 12
13 @copyright: 2004-2007 MoinMoin:ReimarBauer 13 @copyright: 2004-2007 MoinMoin:ReimarBauer
14 2005 BenjaminVrolijk 14 2005 BenjaminVrolijk
15 @license: GNU GPL, see COPYING for details. 15 @license: GNU GPL, see COPYING for details.
16 """ 16 """
17 Dependencies = ['time'] # do not cache 17 Dependencies = ['time'] # do not cache
47 event_log.set_filter([kw["filter"]]) 47 event_log.set_filter([kw["filter"]])
48 for event in event_log.reverse(): 48 for event in event_log.reverse():
49 pagename = event[2].get('pagename', None) 49 pagename = event[2].get('pagename', None)
50 if not kw["all"]: 50 if not kw["all"]:
51 if pagename == formatter.page.page_name: 51 if pagename == formatter.page.page_name:
52 self.count += 1 52 self.count += 1
53 else: 53 else:
54 self.count += 1 54 self.count += 1
55 55
56 return self.count 56 return self.count
57 57