comparison MoinMoin/action/AttachFile.py @ 102:a54cebaab73e

move make / parse query string functions to wikiutil, make unicode-safe imported from: moin--main--1.5--patch-104
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 15 Oct 2005 18:03:12 +0000
parents 2202f548cbb0
children 8b3945dbbb4d
comparison
equal deleted inserted replaced
101:2202f548cbb0 102:a54cebaab73e
26 """ 26 """
27 27
28 import os, mimetypes, time, zipfile 28 import os, mimetypes, time, zipfile
29 from MoinMoin import config, user, util, wikiutil, packages 29 from MoinMoin import config, user, util, wikiutil, packages
30 from MoinMoin.Page import Page 30 from MoinMoin.Page import Page
31 from MoinMoin.util import MoinMoinNoFooter, filesys, web 31 from MoinMoin.util import MoinMoinNoFooter, filesys
32 32
33 action_name = __name__.split('.')[-1] 33 action_name = __name__.split('.')[-1]
34 34
35 def htdocs_access(request): 35 def htdocs_access(request):
36 return isinstance(request.cfg.attachments, type({})) 36 return isinstance(request.cfg.attachments, type({}))
302 pubpath = request.cfg.url_prefix + "/applets/TWikiDrawPlugin" 302 pubpath = request.cfg.url_prefix + "/applets/TWikiDrawPlugin"
303 basename = request.form['drawing'][0] 303 basename = request.form['drawing'][0]
304 drawpath = getAttachUrl(pagename, basename + '.draw', request, escaped=1) 304 drawpath = getAttachUrl(pagename, basename + '.draw', request, escaped=1)
305 pngpath = getAttachUrl(pagename, basename + '.png', request, escaped=1) 305 pngpath = getAttachUrl(pagename, basename + '.png', request, escaped=1)
306 querystr = {'action': 'AttachFile', 'ts': now} 306 querystr = {'action': 'AttachFile', 'ts': now}
307 querystr = wikiutil.escape(web.makeQueryString(querystr)) 307 querystr = wikiutil.escape(wikiutil.makeQueryString(querystr))
308 pagelink = '%s/%s?%s' % (request.getScriptname(), wikiutil.quoteWikinameURL(pagename), querystr) 308 pagelink = '%s/%s?%s' % (request.getScriptname(), wikiutil.quoteWikinameURL(pagename), querystr)
309 helplink = Page(request, "HelpOnActions/AttachFile").url(request) 309 helplink = Page(request, "HelpOnActions/AttachFile").url(request)
310 savelink = Page(request, pagename).url(request) # XXX include target filename param here for twisted 310 savelink = Page(request, pagename).url(request) # XXX include target filename param here for twisted
311 # request, {'savename': request.form['drawing'][0]+'.draw'} 311 # request, {'savename': request.form['drawing'][0]+'.draw'}
312 #savelink = '/cgi-bin/dumpform.bat' 312 #savelink = '/cgi-bin/dumpform.bat'