Attachment 'MacroMarket-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.
  • [get | view] (2007-07-11 12:43:54, 1.1 KB) [[attachment:AllPagesWithACL.py]]
  • [get | view] (2007-07-11 12:45:09, 1.8 KB) [[attachment:LostSoulsInGroups.py]]
  • [get | view] (2007-04-13 10:05:04, 1.1 KB) [[attachment:MacroMarket-AllPagesWithACL.py]]
  • [get | view] (2007-04-24 07:25:22, 3.6 KB) [[attachment:MacroMarket-ManageUsers.py]]
  • [get | view] (2007-05-03 10:22:47, 2.4 KB) [[attachment:MacroMarket-WikiLog.py]]
  • [get | view] (2007-07-11 12:44:58, 3.6 KB) [[attachment:ManageUsers.py]]
  • [get | view] (2007-07-11 12:44:50, 2.4 KB) [[attachment:WikiLog.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.