Last change
on this file since 16536 was
3326,
checked in by Henrik Bettermann, 17 years ago
|
some beautifying
|
-
Property svn:keywords set to
Id
|
File size:
968 bytes
|
Line | |
---|
1 | ## Script (Python) "download_errors" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters= |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: download_errors.py 3326 2008-03-12 22:28:34Z henrik $ |
---|
11 | """ |
---|
12 | export xxx.errors |
---|
13 | """ |
---|
14 | try: |
---|
15 | from Products.zdb import set_trace |
---|
16 | except: |
---|
17 | def set_trace(): |
---|
18 | pass |
---|
19 | request = context.REQUEST |
---|
20 | setheader = request.RESPONSE.setHeader |
---|
21 | #set_trace() |
---|
22 | data = context.getContent()['getErrors']() |
---|
23 | filename = context.getId().replace('.csv','_errors.csv') |
---|
24 | #setheader('Content-type', 'text/x-cvs') |
---|
25 | #setheader('Content-type','application/vnd.ms-excel') |
---|
26 | setheader('Content-type','text/semicolon-seperated-values') |
---|
27 | setheader('Content-Disposition:', 'attachment; filename=%s' % filename) |
---|
28 | setheader('Expires', 'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past |
---|
29 | setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1 |
---|
30 | setheader('Cache-Control', 'post-check=0,pre-check=0') |
---|
31 | #setheader('Pragma', 'no-cache') # HTTP/1.0 |
---|
32 | return data |
---|
Note: See
TracBrowser for help on using the repository browser.