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))