Ticket #7124: trac-0.11b-wiki-macros.diff
| File trac-0.11b-wiki-macros.diff, 1.5 KB (added by TJ <support@…>, 7 months ago) |
|---|
-
wiki/macros.py
a b 94 94 minsize = max(int(kw.get('min', 2)), 2) 95 95 depth = int(kw.get('depth', -1)) 96 96 start = prefix and prefix.count('/') or 0 97 ignore_trac_pages = int(kw.get('ignore', 0)) 97 98 98 99 wiki = formatter.wiki 99 100 pages = sorted([page for page in wiki.get_pages(prefix) \ … … 104 105 href=formatter.href.wiki(page))) 105 106 for page in pages 106 107 if depth < 0 or depth >= page.count('/') - start]) 107 108 108 109 # Group by Wiki word and/or Wiki hierarchy 109 110 pages = [(self.SPLIT_RE.split(wiki.format_page_name(page, split=True)), 110 111 page) for page in pages 111 if depth < 0 or depth >= page.count('/') - start] 112 if ((depth < 0 or depth >= page.count('/') - start) and not ignore_trac_pages) 113 or ((depth < 0 or depth >= page.count('/') - start) and ignore_trac_pages) and 114 (not page.startswith('Inter') and not page.startswith('Trac') and 115 not page.startswith('Wiki') and not page =='CamelCase' and not page == 'PageTemplates' and 116 not page == 'RecentChanges' and not page == 'SandBox' and not page == 'TitleIndex')] 117 112 118 def split_in_groups(group): 113 119 """Return list of pagename or (key, sublist) elements""" 114 120 groups = []
