## Script (Python) "download_pending"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# $Id: download_pending.py 3325 2008-03-12 14:06:44Z joachim $
"""
export xxx.pending
"""
request = context.REQUEST
setheader = request.RESPONSE.setHeader

name,data = context.getContent()['getPending']()

#setheader('Content-type', 'text/x-cvs')
#setheader('Content-type','application/vnd.ms-excel')
setheader('Content-type','text/semicolon-seperated-values')
setheader('Content-Disposition:', 'attachment; filename="%s.csv"' % name)
setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
setheader('Cache-Control', 'post-check=0,pre-check=0')
#setheader('Pragma', 'no-cache') # HTTP/1.0
return data
