#!/usr/bin/env python from MoinMoin import wikiutil, config, user from MoinMoin.Page import Page Dependencies = ["Do not cache"] def execute(macro, args): result="" users = user.getUserList(macro.request) if not users: return macro.formatter.text("Failed to get any users") else: userlist = [] for uid in users: name = user.User(macro.request, id=uid).name userlist.append(name) result="Users: " + str(userlist) pages = macro.request.rootpage.getPageDict() names = pages.keys() for name in names: if pages[name].isUnderlayPage(): del pages[name] continue pagenames=pages.keys() pagenames.sort() result=result+"---------Pages: "+str(pagenames) names = pages.keys() for name in names: badpage=False for u in userlist: if name.startswith(u): badpage=True break if badpage: del pages[name] pagenames=pages.keys() pagenames.sort() r=[] current_letter=None for name in pagenames: if not name: continue letter=wikiutil.getUnicodeIndexGroup(name) if letter != current_letter: current_letter=letter r.append(macro.formatter.heading(1, 3)) r.append(macro.formatter.text(letter)) r.append(macro.formatter.heading(0, 3)) r.append(macro.formatter.pagelink(1, name, generated=1)) r.append(macro.formatter.text(name)) r.append(macro.formatter.pagelink(0, name)) r.append(macro.formatter.linebreak(0)) return ''.join(r) """ result=result+"------Good: "+str(pagenames) return macro.formatter.text(result) """