1.1 --- a/macros/CategoryMenu.py Sat Oct 25 02:09:43 2008 +0200
1.2 +++ b/macros/CategoryMenu.py Sat Nov 01 01:42:32 2008 +0100
1.3 @@ -12,9 +12,15 @@
1.4 from MoinMoin import wikiutil, search, version
1.5 import re
1.6
1.7 +__version__ = "0.1"
1.8 +
1.9 +Dependencies = ['pages']
1.10 +
1.11 +# Regular expressions where MoinMoin does not provide the required support.
1.12 +
1.13 category_regexp = None
1.14
1.15 -Dependencies = ['pages']
1.16 +# Utility functions.
1.17
1.18 def isMoin15():
1.19 return version.release.startswith("1.5.")
1.20 @@ -32,6 +38,8 @@
1.21 category_regexp = re.compile(u'^%s$' % ur'(?P<all>Category(?P<key>(?!Template)\S+))', re.UNICODE)
1.22 return category_regexp
1.23
1.24 +# The main activity functions.
1.25 +
1.26 def getCategories(request):
1.27
1.28 """
1.29 @@ -81,6 +89,12 @@
1.30 return pages
1.31
1.32 def execute(macro, args):
1.33 +
1.34 + """
1.35 + Execute the 'macro' with the given 'args': an optional list of selected
1.36 + category names (categories whose pages are to be shown).
1.37 + """
1.38 +
1.39 request = macro.request
1.40 fmt = macro.formatter
1.41 page = fmt.page
1.42 @@ -153,6 +167,8 @@
1.43 else:
1.44 break
1.45
1.46 + # Use an em-dash to indicate subpages.
1.47 +
1.48 prefix = u"\u2014" * common
1.49 suffix = "/".join(parts[common:])
1.50