Attachment '1.5.5a.patch'
Download 1 --- MoinMoin/Page.py.orig Wed Oct 4 22:43:29 2006
2 +++ MoinMoin/Page.py Wed Oct 4 22:44:19 2006
3 @@ -6,7 +6,7 @@
4 @license: GNU GPL, see COPYING for details.
5 """
6
7 -import StringIO, os, re, random, codecs
8 +import StringIO, os, re, random, codecs, logging
9
10 from MoinMoin import config, caching, user, util, wikiutil
11 from MoinMoin.logfile import eventlog
12 @@ -1516,26 +1516,40 @@
13 More efficient now by using special pagelinks formatter and
14 redirecting possible output into null file.
15 """
16 - request.clock.start('parsePagelinks')
17 + pagename = self.page_name
18 + if request.parsePageLinks_running.get(pagename, False):
19 + #logging.debug("avoid recursion for page %r" % pagename)
20 + return [] # avoid recursion
21 +
22 + #logging.debug("running parsePageLinks for page %r" % pagename)
23 + # remember we are already running this function for this page:
24 + request.parsePageLinks_running[pagename] = True
25 +
26 + request.clock.start('parsePageLinks')
27 +
28 class Null:
29 - def write(self, str): pass
30 + def write(self, data):
31 + pass
32 +
33 request.redirect(Null())
34 - request.mode_getpagelinks = 1
35 + request.mode_getpagelinks += 1
36 + #logging.debug("mode_getpagelinks == %r" % request.mode_getpagelinks)
37 try:
38 try:
39 from MoinMoin.formatter.pagelinks import Formatter
40 formatter = Formatter(request, store_pagelinks=1)
41 - page = Page(request, self.page_name, formatter=formatter)
42 + page = Page(request, pagename, formatter=formatter)
43 page.send_page(request, content_only=1)
44 except:
45 import traceback
46 - traceback.print_exc()
47 + traceback.print_exc(200)
48 finally:
49 - request.mode_getpagelinks = 0
50 + request.mode_getpagelinks -= 1
51 + #logging.debug("mode_getpagelinks == %r" % request.mode_getpagelinks)
52 request.redirect()
53 if hasattr(request, '_fmt_hd_counters'):
54 del request._fmt_hd_counters
55 - request.clock.stop('parsePagelinks')
56 + request.clock.stop('parsePageLinks')
57 return formatter.pagelinks
58
59 def getCategories(self, request):
60 --- MoinMoin/request.py.orig Wed Oct 4 22:59:03 2006
61 +++ MoinMoin/request.py Wed Oct 4 22:50:20 2006
62 @@ -192,7 +192,8 @@
63
64 self.logger = None
65 self.pragma = {}
66 - self.mode_getpagelinks = 0
67 + self.mode_getpagelinks = 0 # is > 0 as long as we are in a getPageLinks call
68 + self.parsePageLinks_running = {} # avoid infinite recursion by remembering what we are already running
69 self.no_closing_html_code = 0
70
71 from MoinMoin import i18n
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.