1.1 --- a/EventAggregatorSupport.py Sun Feb 05 01:52:03 2012 +0100
1.2 +++ b/EventAggregatorSupport.py Sun Feb 05 23:24:31 2012 +0100
1.3 @@ -339,11 +339,10 @@
1.4
1.5 # Formatting-related functions.
1.6
1.7 - def formatText(self, text, request, fmt):
1.8 + def formatText(self, text, fmt):
1.9
1.10 """
1.11 - Format the given 'text' using the specified 'request' and formatter
1.12 - 'fmt'.
1.13 + Format the given 'text' using the specified formatter 'fmt'.
1.14 """
1.15
1.16 # Assume plain text which is then formatted appropriately.
1.17 @@ -706,30 +705,32 @@
1.18
1.19 # Formatting-related functions.
1.20
1.21 - def getParserClass(self, request, format):
1.22 + def getParserClass(self, format):
1.23
1.24 """
1.25 - Return a parser class using the 'request' for the given 'format', returning
1.26 - a plain text parser if no parser can be found for the specified 'format'.
1.27 + Return a parser class for the given 'format', returning a plain text
1.28 + parser if no parser can be found for the specified 'format'.
1.29 """
1.30
1.31 + cfg = self.page.request.cfg
1.32 +
1.33 try:
1.34 - return wikiutil.searchAndImportPlugin(request.cfg, "parser", format or "plain")
1.35 + return wikiutil.searchAndImportPlugin(cfg, "parser", format or "plain")
1.36 except wikiutil.PluginMissingError:
1.37 - return wikiutil.searchAndImportPlugin(request.cfg, "parser", "plain")
1.38 -
1.39 - def formatText(self, text, request, fmt):
1.40 + return wikiutil.searchAndImportPlugin(cfg, "parser", "plain")
1.41 +
1.42 + def formatText(self, text, fmt):
1.43
1.44 """
1.45 - Format the given 'text' using the specified 'request' and formatter
1.46 - 'fmt'.
1.47 + Format the given 'text' using the specified formatter 'fmt'.
1.48 """
1.49
1.50 - fmt.page = self.page
1.51 + fmt.page = page = self.page
1.52 + request = page.request
1.53
1.54 # Suppress line anchors.
1.55
1.56 - parser_cls = self.getParserClass(request, self.getFormat())
1.57 + parser_cls = self.getParserClass(self.getFormat())
1.58 parser = parser_cls(text, request, line_anchors=False)
1.59
1.60 # Fix lists by indicating that a paragraph is already started.
1.61 @@ -2795,7 +2796,7 @@
1.62 output.append(fmt.table_cell(on=1, attrs=attrs))
1.63
1.64 if event_details.has_key("location"):
1.65 - output.append(event_page.formatText(event_details["location"], request, fmt))
1.66 + output.append(event_page.formatText(event_details["location"], fmt))
1.67
1.68 output.append(fmt.table_cell(on=0))
1.69
1.70 @@ -3111,7 +3112,7 @@
1.71
1.72 if event_details.has_key("location"):
1.73 output.append(fmt.paragraph(on=1))
1.74 - output.append(event_page.formatText(event_details["location"], request, fmt))
1.75 + output.append(event_page.formatText(event_details["location"], fmt))
1.76 output.append(fmt.paragraph(on=1))
1.77
1.78 # Topics.
1.79 @@ -3121,7 +3122,7 @@
1.80
1.81 for topic in event_details.get("topics") or event_details.get("categories") or []:
1.82 output.append(fmt.listitem(on=1))
1.83 - output.append(event_page.formatText(topic, request, fmt))
1.84 + output.append(event_page.formatText(topic, fmt))
1.85 output.append(fmt.listitem(on=0))
1.86
1.87 output.append(fmt.bullet_list(on=0))
2.1 --- a/actions/EventAggregatorSummary.py Sun Feb 05 01:52:03 2012 +0100
2.2 +++ b/actions/EventAggregatorSummary.py Sun Feb 05 23:24:31 2012 +0100
2.3 @@ -2,7 +2,7 @@
2.4 """
2.5 MoinMoin - EventAggregatorSummary Action
2.6
2.7 - @copyright: 2008, 2009, 2010, 2011 by Paul Boddie <paul@boddie.org.uk>
2.8 + @copyright: 2008, 2009, 2010, 2011, 2012 by Paul Boddie <paul@boddie.org.uk>
2.9 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
2.10 2003-2008 MoinMoin:ThomasWaldmann,
2.11 2004-2006 MoinMoin:AlexanderSchremmer,
2.12 @@ -423,11 +423,11 @@
2.13 description = event_details["last-comment"]
2.14
2.15 request.write('<description>%s</description>\r\n' %
2.16 - fmt.text(event_page.formatText(description, request, fmt)))
2.17 + fmt.text(event_page.formatText(description, fmt)))
2.18
2.19 for topic in event_details.get("topics") or event_details.get("categories") or []:
2.20 request.write('<category>%s</category>\r\n' %
2.21 - fmt.text(event_page.formatText(topic, request, fmt)))
2.22 + fmt.text(event_page.formatText(topic, fmt)))
2.23
2.24 request.write('<pubDate>%s</pubDate>\r\n' % event_details["created"].as_HTTP_datetime_string())
2.25 request.write('<guid>%s#%s</guid>\r\n' % (link, event_details["sequence"]))
3.1 --- a/macros/EventAggregator.py Sun Feb 05 01:52:03 2012 +0100
3.2 +++ b/macros/EventAggregator.py Sun Feb 05 23:24:31 2012 +0100
3.3 @@ -2,7 +2,7 @@
3.4 """
3.5 MoinMoin - EventAggregator Macro
3.6
3.7 - @copyright: 2008, 2009, 2010, 2011 by Paul Boddie <paul@boddie.org.uk>
3.8 + @copyright: 2008, 2009, 2010, 2011, 2012 by Paul Boddie <paul@boddie.org.uk>
3.9 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
3.10 2005-2008 MoinMoin:ThomasWaldmann
3.11 @license: GNU GPL (v2 or later), see COPYING.txt for details.