Mercurial > moin > 1.9
changeset 1833:af0feb0e3c7b
AttachFile: more usage of the formatter
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Mon, 26 Feb 2007 00:09:20 +0100 |
parents | b180f047d918 |
children | b3fe6f3eff1c 42fb37416fe8 |
files | MoinMoin/action/AttachFile.py |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py Sun Feb 25 23:45:07 2007 +0100 +++ b/MoinMoin/action/AttachFile.py Mon Feb 26 00:09:20 2007 +0100 @@ -961,15 +961,14 @@ getAttachUrl(pagename, filename, request, escaped=1), timestamp, wikiutil.escape(filename, 1))) return elif mt.major == 'text': - # TODO: should use formatter here! - request.write("<pre>") + request.write(request.formatter.preformatted(1)) # Try to decode file contents. It may return junk, but we # don't have enough information on attachments. content = open(fpath, 'r').read() content = wikiutil.decodeUnknownInput(content) content = wikiutil.escape(content) - request.write(content) - request.write("</pre>") + request.write(request.formatter.text(content)) + request.write(request.formatter.preformatted(0)) return package = packages.ZipPackage(request, fpath) @@ -1006,11 +1005,10 @@ request.theme.send_title(title, pagename=pagename) # send body - # TODO: use formatter startContent? - request.write('<div id="content">\n') # start content div + request.write(request.formatter.startContent()) send_viewfile(pagename, request) send_uploadform(pagename, request) - request.write('</div>\n') # end content div + request.write(request.formatter.endContent()) request.theme.send_footer(pagename) request.theme.send_closing_html()