Mercurial > p > roundup > code
comparison roundup/cgi/actions.py @ 2592:5a8d9465827e
implement the HTTP HEAD command [SF#992544]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 20 Jul 2004 02:07:58 +0000 |
| parents | 420d5c2a49d9 |
| children | 1df7d4a41da4 |
comparison
equal
deleted
inserted
replaced
| 2591:5f52d113de0c | 2592:5a8d9465827e |
|---|---|
| 1 #$Id: actions.py,v 1.34 2004-07-13 09:41:15 a1s Exp $ | 1 #$Id: actions.py,v 1.35 2004-07-20 02:07:58 richard Exp $ |
| 2 | 2 |
| 3 import re, cgi, StringIO, urllib, Cookie, time, random | 3 import re, cgi, StringIO, urllib, Cookie, time, random |
| 4 | 4 |
| 5 from roundup import hyperdb, token, date, password, rcsv, exceptions | 5 from roundup import hyperdb, token, date, password, rcsv, exceptions |
| 6 from roundup.i18n import _ | 6 from roundup.i18n import _ |
| 880 | 880 |
| 881 h = self.client.additional_headers | 881 h = self.client.additional_headers |
| 882 h['Content-Type'] = 'text/csv' | 882 h['Content-Type'] = 'text/csv' |
| 883 # some browsers will honor the filename here... | 883 # some browsers will honor the filename here... |
| 884 h['Content-Disposition'] = 'inline; filename=query.csv' | 884 h['Content-Disposition'] = 'inline; filename=query.csv' |
| 885 | |
| 885 self.client.header() | 886 self.client.header() |
| 887 | |
| 888 if self.client.env['REQUEST_METHOD'] == 'HEAD': | |
| 889 # all done, return a dummy string | |
| 890 return 'dummy' | |
| 891 | |
| 886 writer = rcsv.writer(self.client.request.wfile) | 892 writer = rcsv.writer(self.client.request.wfile) |
| 887 writer.writerow(columns) | 893 writer.writerow(columns) |
| 888 | 894 |
| 889 # and search | 895 # and search |
| 890 for itemid in klass.filter(matches, filterspec, sort, group): | 896 for itemid in klass.filter(matches, filterspec, sort, group): |
