changeset 526:56cbdae11f25

macro.ListPages: new keyword list_type for selecting number or bullet list
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 16 May 2010 13:26:17 +0200
parents 766d8ba45f84
children 09b97ed541e2
files data/plugin/macro/ListPages.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/ListPages.py	Fri May 07 20:30:12 2010 +0200
+++ b/data/plugin/macro/ListPages.py	Sun May 16 13:26:17 2010 +0200
@@ -15,10 +15,11 @@
 import re
 from MoinMoin import search, wikiutil
 
-def macro_ListPages(macro, search_term=u'.+'):
+def macro_ListPages(macro, search_term=u'.+', list_type=("number_list", "bullet_list")):
     """
     lists pages
     @param search_term: regex for searching of page titles
+    @param list_type: select type of list in between number_list and bullet_list
     """
     _ = macro._
     case = 0
@@ -40,7 +41,10 @@
                page.page_name,
                f.url(0)]) for page in pageobjs]
         ret.sort()
-        ret = ''.join([f.number_list(1), ''.join(ret), f.number_list(0)])
+        if list_type == "number_list":
+            ret = ''.join([f.number_list(1), ''.join(ret), f.number_list(0)])
+        if list_type == "bullet_list":
+            ret = ''.join([f.bullet_list(1), ''.join(ret), f.bullet_list(0)])
     except ValueError:
         # same error as in MoinMoin/action/fullsearch.py, keep it that way!
         ret = ''.join([macro.formatter.text('<<PageList('),