Skip to content

Commit e16dc11

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 9b91480 commit e16dc11

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Fixed:
1313
- fixed RDBMS filter() for no matches from full-text search (sf bug 990778)
1414
- fixed DateHTMLProperty for invalid date entry (sf bug 986538)
1515
- fixed external password source example (sf bug 986601)
16+
- document the STATIC_FILES config var
17+
- implement the HTTP HEAD command (sf bug 992544)
1618

1719

1820
2004-06-24 0.7.5

doc/customizing.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ The configuration variables available are:
118118
This is the directory that the HTML templates reside in. By default they are
119119
in the tracker home.
120120

121+
**STATIC_FILES** - e.g. ``os.path.join(TRACKER_HOME, 'files')``
122+
This *optional* variable defines the directory that static files are served
123+
from (files with the URL ``/@@file/<filename>``). If this is not defined,
124+
then static files are served from the TEMPLATES directory.
125+
121126
**TRACKER_NAME** - ``'Roundup issue tracker'``
122127
A descriptive name for your roundup tracker. This is sent out in e-mails and
123128
appears in the heading of CGI pages.
@@ -227,6 +232,11 @@ tracker is attempted.::
227232
# This is the directory that the HTML templates reside in
228233
TEMPLATES = os.path.join(TRACKER_HOME, 'html')
229234

235+
# Optional: the directory that static files are served from (files with
236+
# the URL /@@file/<filename>). If this is not defined, then static files
237+
# are served from the TEMPLATES directory.
238+
# STATIC_FILES = os.path.join(TRACKER_HOME, 'files')
239+
230240
# A descriptive name for your roundup tracker
231241
TRACKER_NAME = 'Roundup issue tracker'
232242

roundup/cgi/actions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: actions.py,v 1.27.2.3 2004-05-28 01:03:53 richard Exp $
1+
#$Id: actions.py,v 1.27.2.4 2004-07-20 02:10:43 richard Exp $
22

33
import re, cgi, StringIO, urllib, Cookie, time, random
44

@@ -859,7 +859,13 @@ def handle(self):
859859
h['Content-Type'] = 'text/csv'
860860
# some browsers will honor the filename here...
861861
h['Content-Disposition'] = 'inline; filename=query.csv'
862+
862863
self.client.header()
864+
865+
if self.client.env['REQUEST_METHOD'] == 'HEAD':
866+
# all done, return a dummy string
867+
return 'dummy'
868+
863869
writer = rcsv.writer(self.client.request.wfile)
864870
writer.writerow(columns)
865871

roundup/cgi/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.176.2.2 2004-06-22 23:36:49 richard Exp $
1+
# $Id: client.py,v 1.176.2.3 2004-07-20 02:10:43 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -596,7 +596,8 @@ def handle_action(self):
596596
def write(self, content):
597597
if not self.headers_done:
598598
self.header()
599-
self.request.wfile.write(content)
599+
if self.env['REQUEST_METHOD'] != 'HEAD':
600+
self.request.wfile.write(content)
600601

601602
def setHeader(self, header, value):
602603
'''Override a header to be returned to the user's browser.

roundup/scripts/roundup_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
"""Command-line script that runs a server over roundup.cgi.client.
1919
20-
$Id: roundup_server.py,v 1.46.2.4 2004-06-21 04:56:34 richard Exp $
20+
$Id: roundup_server.py,v 1.46.2.5 2004-07-20 02:10:43 richard Exp $
2121
"""
2222
__docformat__ = 'restructuredtext'
2323

@@ -118,7 +118,7 @@ def run_cgi(self):
118118
self.wfile.write("</pre>\n")
119119
sys.stdin = save_stdin
120120

121-
do_GET = do_POST = run_cgi
121+
do_GET = do_POST = do_HEAD = run_cgi
122122

123123
def index(self):
124124
''' Print up an index of the available trackers

templates/classic/config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: config.py,v 1.8 2004-03-26 23:45:34 richard Exp $
18+
# $Id: config.py,v 1.8.2.1 2004-07-20 02:10:43 richard Exp $
1919

2020
import os
2121

@@ -48,6 +48,11 @@
4848
# This is the directory that the HTML templates reside in
4949
TEMPLATES = os.path.join(TRACKER_HOME, 'html')
5050

51+
# Optional: the directory that static files are served from (files with the
52+
# URL /@@file/<filename>). If this is not defined, then static files are
53+
# served from the TEMPLATES directory.
54+
# STATIC_FILES = os.path.join(TRACKER_HOME, 'files')
55+
5156
# A descriptive name for your roundup instance
5257
TRACKER_NAME = 'Roundup issue tracker'
5358

0 commit comments

Comments
 (0)