Commit 089aed7b authored by Romain Courteaud's avatar Romain Courteaud

Create temporary directories in /tmp.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4322 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00483499
...@@ -136,12 +136,16 @@ class TemplateTool (BaseTool): ...@@ -136,12 +136,16 @@ class TemplateTool (BaseTool):
""" """
Export BT in tarball format Export BT in tarball format
""" """
path = business_template.getTitle() tmpfile_path = os.tmpnam()
tmpdir_path = os.path.dirname(tmpfile_path)
path = os.path.join(tmpdir_path, business_template.getTitle())
export_string = business_template.export(path=path) export_string = business_template.export(path=path)
if RESPONSE is not None: if RESPONSE is not None:
RESPONSE.setHeader('Content-type','tar/x-gzip') RESPONSE.setHeader('Content-type','tar/x-gzip')
RESPONSE.setHeader('Content-Disposition', RESPONSE.setHeader('Content-Disposition',
'inline;filename=%s-%s.bt5' % (business_template.getTitle(), business_template.getVersion())) 'inline;filename=%s-%s.bt5' % \
(business_template.getTitle(),
business_template.getVersion()))
try: try:
return export_string.getvalue() return export_string.getvalue()
finally: finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment