diff MoinMoin/action/AttachFile.py @ 3266:f62792cb2d24

macro.EmbedObject: adjusted to changes of argument parser, escaped output.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 16 Mar 2008 17:35:30 +0100
parents ba0707fe183d
children 65be8803b8df
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sun Mar 16 16:36:06 2008 +0100
+++ b/MoinMoin/action/AttachFile.py	Sun Mar 16 17:35:30 2008 +0100
@@ -991,14 +991,15 @@
         request.write("</pre>")
         return
 
-    # reuse class tmp from Despam to define macro
-    from MoinMoin.action.Despam import tmp
-    macro = tmp()
+    from MoinMoin import macro
+    from MoinMoin.parser.text import Parser
+
     macro.request = request
     macro.formatter = request.html_formatter
+    p = Parser("##\n", request)
+    m = macro.Macro(p)
 
     # use EmbedObject to view valid mime types
-    from MoinMoin.macro import EmbedObject
     if mt is None:
         request.write('<p>' + _("Unknown file type, cannot display this attachment inline.") + '</p>')
         link = (fmt.url(1, getAttachUrl(pagename, filename, request)) +
@@ -1006,8 +1007,7 @@
                 fmt.url(0))
         request.write('For using an external program follow this link %s' % link)
         return
-
-    request.write(EmbedObject.macro_EmbedObject(macro, filename, pagename=pagename))
+    request.write(m.execute('EmbedObject', u'target=%s, pagename=%s' % (filename, pagename)))
     return