Attachment 'AllPagesWithACL.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - AllPagesWithACL Macro
4
5 Copyright (c) 2007 by Alexander "Loki" Agibalov
6 """
7
8 import os
9 import re
10 from MoinMoin.Page import Page
11 from MoinMoin.PageEditor import PageEditor
12
13 def getAcl(request, pg):
14 pged = PageEditor(request, pg)
15 pagetext = pged.get_raw_body()
16 search=re.compile("^#acl.*\n", re.M).search(pagetext)
17 if search:
18 ret=search.group()
19 else:
20 ret="not defined"
21 return ret
22
23 def execute(macro, args):
24
25 html="<p><b>All pages:</b><br>"
26 all={}
27 pages = macro.request.rootpage.getPageList()
28 # pages = macro.request.rootpage.getPageList(filter=re.compile("^WikiSandBox").match)
29 html+="Total: %s pages </p>" % str(len(pages))
30
31 for pagename in pages:
32 all[Page(macro.request, pagename).link_to(macro.request)]=getAcl(macro.request, pagename)
33
34 html+="<table>"
35 all1=sorted(all.items())
36 for pg, ac in all1:
37 html+="<tr><td>%s</td>" % pg
38 html+="<td>%s</td></tr>" % ac
39 html+="</table>"
40 return macro.formatter.rawHTML(html)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.