changeset 3226:42a7e375e4fd

merged main
author Mikko Virkkil? <mvirkkil@cc.hut.fi>
date Sun, 09 Mar 2008 16:23:02 +0100
parents 76015771ce72 (current diff) a4e5f28467b6 (diff)
children c545e53c1b76
files
diffstat 3 files changed, 25 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sun Mar 09 16:22:32 2008 +0100
+++ b/MoinMoin/config/multiconfig.py	Sun Mar 09 16:23:02 2008 +0100
@@ -884,8 +884,8 @@
                 self._subscribable_events = events.get_subscribable_events()
             return getattr(self, "_subscribable_events")
 
-        def setter(self, new_handlers):
-            self._event_handlers = new_handlers
+        def setter(self, new_events):
+            self._subscribable_events = new_events
 
         return property(getter, setter)
     subscribable_events = make_subscribable_events_prop()
@@ -896,7 +896,11 @@
             if getattr(self, "_event_handlers", None) is None:
                 self._event_handlers = events.get_handlers(self)
             return getattr(self, "_event_handlers")
-        return property(getter)
+        
+        def setter(self, new_handlers):
+            self._event_handlers = new_handlers
+            
+        return property(getter, setter)
     event_handlers = make_event_handlers_prop()
 
     def load_IWID(self):
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py	Sun Mar 09 16:22:32 2008 +0100
+++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py	Sun Mar 09 16:23:02 2008 +0100
@@ -579,6 +579,23 @@
             result = self.needle.search(html).group(1)
             assert result == expected
 
+class TestMacrosInOneLine(ParserTestCase):
+    """ Test macro formatting """
+    text = 'AAA %s AAA'
+    needle = re.compile(text % r'(.+)')
+    _tests = (
+        # test                              expected
+        (u'<<Verbatim(A)>><<Verbatim(a)>>', 'Aa'),
+        (u'<<Verbatim(A)>> <<Verbatim(a)>>', 'A a'),
+        )
+
+    def testMultipleMacrosInOneLine(self):
+        """ parser.wiki: multiple macros in one line and no linebreak """
+        for test, expected in self._tests:
+            html = self.parse(self.text % test)
+            result = self.needle.search(html).group(1)
+            assert result == expected
+
 
 coverage_modules = ['MoinMoin.parser.text_moin_wiki']
 
--- a/MoinMoin/parser/text_moin_wiki.py	Sun Mar 09 16:22:32 2008 +0100
+++ b/MoinMoin/parser/text_moin_wiki.py	Sun Mar 09 16:23:02 2008 +0100
@@ -399,7 +399,6 @@
         # 'found_parser' == we found a valid parser (was: 2)
         self.in_pre = None
 
-        self.no_862 = False
         self.in_table = 0
         self.inhibit_p = 0 # if set, do not auto-create a <p>aragraph
 
@@ -1320,8 +1319,7 @@
                         self._parser_content(line[lastpos:start])
                     else:
                         ###result.append(u'<span class="info">[add text before match: <tt>"%s"</tt>]</span>' % line[lastpos:match.start()])
-                        # self.no_862 is added to solve the issue of macros called inline
-                        if not (inhibit_p or self.inhibit_p or self.in_pre or self.formatter.in_p or self.no_862):
+                        if not (inhibit_p or self.inhibit_p or self.in_pre or self.formatter.in_p):
                             result.append(self.formatter.paragraph(1, css_class="line862"))
                         # add the simple text in between lastpos and beginning of current match
                         result.append(self.formatter.text(line[lastpos:start]))
@@ -1416,9 +1414,6 @@
         for line in self.lines:
             self.lineno += 1
 
-            if '>><<' in line.replace(' ', ''):
-                self.no_862 = True
-
             self.line_anchor_printed = 0
             if not self.in_table:
                 self.request.write(self._line_anchordef())