comparison MoinMoin/action/AttachFile.py @ 2885:48a1f6b6b6c5

AttachFile.getFilename: creates attachment dir on requesting filename
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 03 Oct 2007 10:46:10 +0200
parents 4825f1a252dc
children ba14d391c2ba
comparison
equal deleted inserted replaced
2884:5e18b0808ab0 2885:48a1f6b6b6c5
165 @rtype: string (in config.charset encoding) 165 @rtype: string (in config.charset encoding)
166 @return: complete path/filename of attached file 166 @return: complete path/filename of attached file
167 """ 167 """
168 if isinstance(filename, unicode): 168 if isinstance(filename, unicode):
169 filename = filename.encode(config.charset) 169 filename = filename.encode(config.charset)
170 return os.path.join(getAttachDir(request, pagename), filename) 170 return os.path.join(getAttachDir(request, pagename, create=1), filename)
171 171
172 def exists(request, pagename, filename): 172 def exists(request, pagename, filename):
173 """ check if page <pagename> has a file <filename> attached """ 173 """ check if page <pagename> has a file <filename> attached """
174 fpath = getFilename(request, pagename, filename) 174 fpath = getFilename(request, pagename, filename)
175 return os.path.exists(fpath) 175 return os.path.exists(fpath)