changeset 5639:689e2b04bd4d

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 30 Mar 2010 22:24:57 +0200
parents bd7e0107fbbb (current diff) 788131dd21c3 (diff)
children 3cb7a64eaef5
files MoinMoin/Page.py MoinMoin/action/Despam.py MoinMoin/formatter/text_docbook.py MoinMoin/script/old/migration/12_to_13_mig01.py
diffstat 4 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Mar 27 12:56:39 2010 +0100
+++ b/MoinMoin/Page.py	Tue Mar 30 22:24:57 2010 +0200
@@ -492,7 +492,7 @@
                 os.makedirs(dirname)
             except OSError, err:
                 if not os.path.exists(dirname):
-                    raise err
+                    raise
         return underlay, fullpath
 
     def getPagePath(self, *args, **kw):
--- a/MoinMoin/action/Despam.py	Sat Mar 27 12:56:39 2010 +0100
+++ b/MoinMoin/action/Despam.py	Tue Mar 30 22:24:57 2010 +0200
@@ -176,14 +176,14 @@
             if repr(line.getInterwikiEditorData(request)) == editor:
                 revertpages.append(line.pagename)
 
-    request.write("Pages to revert:<br>%s" % "<br>".join(revertpages))
+    request.write("Pages to revert:<br>%s" % "<br>".join([wikiutil.escape(p) for p in revertpages]))
     for pagename in revertpages:
-        request.write("Begin reverting %s ...<br>" % pagename)
+        request.write("Begin reverting %s ...<br>" % wikiutil.escape(pagename))
         msg = revert_page(request, pagename, editor)
         if msg:
             request.write("<p>%s: %s</p>" % (
                 Page.Page(request, pagename).link_to(request), msg))
-        request.write("Finished reverting %s.<br>" % pagename)
+        request.write("Finished reverting %s.<br>" % wikiutil.escape(pagename))
 
 def execute(pagename, request):
     _ = request.getText
--- a/MoinMoin/formatter/text_docbook.py	Sat Mar 27 12:56:39 2010 +0100
+++ b/MoinMoin/formatter/text_docbook.py	Tue Mar 30 22:24:57 2010 +0200
@@ -9,7 +9,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os
+import os,re
 
 from xml.dom import getDOMImplementation
 from xml.dom.ext.reader import Sax
@@ -611,7 +611,12 @@
             was_in_para = self.cur.nodeName == "para"
             if was_in_para:
                 self.paragraph(0)
-            text = FormatterBase.macro(self, macro_obj, name, args)
+            
+            # Regular Expression to match editlink arg, remove it because it causes trouble.
+            _arg_editlink = r'(,\s*(?P<editlink>editlink))?'
+            macro_args = re.sub(_arg_editlink, '', args)
+        
+            text = FormatterBase.macro(self, macro_obj, name, macro_args)
             if text.strip():
                 self._copyExternalNodes(Sax.FromXml(text).documentElement.childNodes, exclude=excludes)
             if was_in_para:
--- a/MoinMoin/script/old/migration/12_to_13_mig01.py	Sat Mar 27 12:56:39 2010 +0100
+++ b/MoinMoin/script/old/migration/12_to_13_mig01.py	Tue Mar 30 22:24:57 2010 +0200
@@ -93,7 +93,7 @@
     print "%s -> %s" % (fname_from, fname_to)
     file_from = open(fname_from, "rb")
     if os.path.exists(fname_to):
-        raise "file exists %s" % fname_to
+        raise Exception("file exists %s" % fname_to)
     file_to = open(fname_to, "wb")
     for line in file_from:
         file_to.write(convert_string(line, enc_from, enc_to))