diff MoinMoin/wikiutil.py @ 517:39da9e68875c

wikiutil.parseAttribute extension now must return a tuple (found_flag, errmsg), fixing table attr parsing imported from: moin--main--1.5--patch-521
author Thomas Waldmann <tw@waldmann-edv.de>
date Wed, 29 Mar 2006 07:12:28 +0000
parents 1b9f0d6b9f48
children d141b2a723cf
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Tue Mar 28 22:07:11 2006 +0000
+++ b/MoinMoin/wikiutil.py	Wed Mar 29 07:12:28 2006 +0000
@@ -928,8 +928,8 @@
     Parse a list of attributes and return a dict plus a possible
     error message.
     If extension is passed, it has to be a callable that returns
-    None when it was not interested into the token, '' when all was OK
-    and it did eat the token, and any other string to return an error
+    a tuple (found_flag, msg). found_flag is whether it did find and process
+    something, msg is '' when all was OK or any other string to return an error
     message.
     
     @param request: the request object
@@ -960,9 +960,13 @@
 
         # call extension function with the current token, the parser, and the dict
         if extension:
-            msg = extension(key, parser, attrs)
-            if msg == '': continue
-            if msg: break
+            found_flag, msg = extension(key, parser, attrs)
+            #request.log("%r = extension(%r, parser, %r)" % (msg, key, attrs))
+            if found_flag:
+                continue
+            elif msg:
+                break
+            #else (we found nothing, but also didn't have an error msg) we just continue below:
 
         try:
             eq = parser.get_token()