changeset 2601:29657277dd37

show new 1.6 quoted attachment syntax in attachment list
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Aug 2007 17:35:24 +0200
parents 4add21cdd6e8
children b601db2e4d34
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Aug 04 16:55:09 2007 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Aug 04 17:35:24 2007 +0200
@@ -315,6 +315,9 @@
 
             base, ext = os.path.splitext(file)
             get_url = getAttachUrl(pagename, file, request, escaped=1)
+            qfname = wikiutil.escape(file)
+            if ' ' in qfname:
+                qfname = wikiutil.quoteName(qfname)
             parmdict = {'baseurl': baseurl, 'urlpagename': urlpagename, 'action': action,
                         'urlfile': urlfile, 'label_del': label_del,
                         'label_move': label_move,
@@ -323,7 +326,7 @@
                         'label_unzip': label_unzip,
                         'label_install': label_install,
                         'get_url': get_url, 'label_get': label_get,
-                        'file': wikiutil.escape(file).replace(' ', '%20'),
+                        'file': qfname,
                         'fsize': fsize,
                         'fmtime': fmtime,
                         'pagename': pagename}
@@ -356,7 +359,7 @@
             parmdict['move_link'] = move_link
             html += ('<li>[%(del_link)s%(move_link)s'
                 '<a href="%(get_url)s">%(label_get)s</a>&nbsp;| %(viewlink)s]'
-                ' (%(fmtime)s, %(fsize)s KB) attachment:<strong>%(file)s</strong></li>') % parmdict
+                ' (%(fmtime)s, %(fsize)s KB) attachment:%(file)s</li>') % parmdict
         html += "</ul>"
     else:
         if showheader: