1.1 --- a/macros/IncludeComments.py Sun Nov 03 23:26:52 2013 +0100
1.2 +++ b/macros/IncludeComments.py Wed Nov 06 15:13:28 2013 +0100
1.3 @@ -16,6 +16,7 @@
1.4 from MoinMoin.macro import Include
1.5 from MoinMoin.user import User
1.6 from MoinMoin.wikiutil import escape
1.7 +from SubpageComments import get_comment_numbers
1.8 import re
1.9 import codecs
1.10
1.11 @@ -68,18 +69,16 @@
1.12 </div>
1.13 """ % d)
1.14
1.15 + # Add included comments.
1.16 +
1.17 + pages = get_comment_numbers(pagename, request)
1.18 +
1.19 + ownerfn = re.compile("^#pragma comment-owner (.*?)$", re.MULTILINE | re.UNICODE).search
1.20 +
1.21 # NOTE: Much of the code below originates from the Include macro, but it
1.22 # NOTE: excludes various options of that macro and adds comment-related
1.23 # NOTE: output.
1.24
1.25 - # Add included comments.
1.26 -
1.27 - filterfn = re.compile(ur"^%s/" % re.escape(pagename), re.U).match
1.28 - pages = request.rootpage.getPageList(filter=filterfn)
1.29 - pages.sort()
1.30 -
1.31 - ownerfn = re.compile("^#pragma comment-owner (.*?)$", re.MULTILINE | re.UNICODE).search
1.32 -
1.33 # Track included pages.
1.34
1.35 if not hasattr(page, '_macroInclude_pagelist'):
1.36 @@ -88,6 +87,7 @@
1.37 # Visit each comment page.
1.38
1.39 for inc_name in pages:
1.40 + inc_name = "%s/%04d" % (pagename, inc_name)
1.41
1.42 # Skip unreadable or already included pages.
1.43