changeset 2593:9e1c4c932323 maint-0.7

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Tue, 20 Jul 2004 02:10:43 +0000
parents cc3726fc8830
children 7b2ea468381a
files CHANGES.txt doc/customizing.txt roundup/cgi/actions.py roundup/cgi/client.py roundup/scripts/roundup_server.py templates/classic/config.py
diffstat 6 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Tue Jul 20 00:23:14 2004 +0000
+++ b/CHANGES.txt	Tue Jul 20 02:10:43 2004 +0000
@@ -13,6 +13,8 @@
 - fixed RDBMS filter() for no matches from full-text search (sf bug 990778)
 - fixed DateHTMLProperty for invalid date entry (sf bug 986538)
 - fixed external password source example (sf bug 986601)
+- document the STATIC_FILES config var
+- implement the HTTP HEAD command (sf bug 992544)
 
 
 2004-06-24 0.7.5
--- a/doc/customizing.txt	Tue Jul 20 00:23:14 2004 +0000
+++ b/doc/customizing.txt	Tue Jul 20 02:10:43 2004 +0000
@@ -118,6 +118,11 @@
  This is the directory that the HTML templates reside in. By default they are
  in the tracker home.
 
+**STATIC_FILES** - e.g. ``os.path.join(TRACKER_HOME, 'files')``
+ This *optional* variable defines the directory that static files are served
+ from (files with the URL ``/@@file/<filename>``). If this is not defined,
+ then static files are served from the TEMPLATES directory.
+
 **TRACKER_NAME** - ``'Roundup issue tracker'``
  A descriptive name for your roundup tracker. This is sent out in e-mails and
  appears in the heading of CGI pages.
@@ -227,6 +232,11 @@
     # This is the directory that the HTML templates reside in
     TEMPLATES = os.path.join(TRACKER_HOME, 'html')
 
+    # Optional: the directory that static files are served from (files with
+    # the URL /@@file/<filename>). If this is not defined, then static files
+    # are served from the TEMPLATES directory.
+    # STATIC_FILES = os.path.join(TRACKER_HOME, 'files')
+
     # A descriptive name for your roundup tracker
     TRACKER_NAME = 'Roundup issue tracker'
 
--- a/roundup/cgi/actions.py	Tue Jul 20 00:23:14 2004 +0000
+++ b/roundup/cgi/actions.py	Tue Jul 20 02:10:43 2004 +0000
@@ -1,4 +1,4 @@
-#$Id: actions.py,v 1.27.2.3 2004-05-28 01:03:53 richard Exp $
+#$Id: actions.py,v 1.27.2.4 2004-07-20 02:10:43 richard Exp $
 
 import re, cgi, StringIO, urllib, Cookie, time, random
 
@@ -859,7 +859,13 @@
         h['Content-Type'] = 'text/csv'
         # some browsers will honor the filename here...
         h['Content-Disposition'] = 'inline; filename=query.csv'
+
         self.client.header()
+
+        if self.client.env['REQUEST_METHOD'] == 'HEAD':
+            # all done, return a dummy string
+            return 'dummy'
+
         writer = rcsv.writer(self.client.request.wfile)
         writer.writerow(columns)
 
--- a/roundup/cgi/client.py	Tue Jul 20 00:23:14 2004 +0000
+++ b/roundup/cgi/client.py	Tue Jul 20 02:10:43 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.176.2.2 2004-06-22 23:36:49 richard Exp $
+# $Id: client.py,v 1.176.2.3 2004-07-20 02:10:43 richard Exp $
 
 """WWW request handler (also used in the stand-alone server).
 """
@@ -596,7 +596,8 @@
     def write(self, content):
         if not self.headers_done:
             self.header()
-        self.request.wfile.write(content)
+        if self.env['REQUEST_METHOD'] != 'HEAD':
+            self.request.wfile.write(content)
 
     def setHeader(self, header, value):
         '''Override a header to be returned to the user's browser.
--- a/roundup/scripts/roundup_server.py	Tue Jul 20 00:23:14 2004 +0000
+++ b/roundup/scripts/roundup_server.py	Tue Jul 20 02:10:43 2004 +0000
@@ -17,7 +17,7 @@
 
 """Command-line script that runs a server over roundup.cgi.client.
 
-$Id: roundup_server.py,v 1.46.2.4 2004-06-21 04:56:34 richard Exp $
+$Id: roundup_server.py,v 1.46.2.5 2004-07-20 02:10:43 richard Exp $
 """
 __docformat__ = 'restructuredtext'
 
@@ -118,7 +118,7 @@
                     self.wfile.write("</pre>\n")
         sys.stdin = save_stdin
 
-    do_GET = do_POST = run_cgi
+    do_GET = do_POST = do_HEAD = run_cgi
 
     def index(self):
         ''' Print up an index of the available trackers
--- a/templates/classic/config.py	Tue Jul 20 00:23:14 2004 +0000
+++ b/templates/classic/config.py	Tue Jul 20 02:10:43 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: config.py,v 1.8 2004-03-26 23:45:34 richard Exp $
+# $Id: config.py,v 1.8.2.1 2004-07-20 02:10:43 richard Exp $
 
 import os
 
@@ -48,6 +48,11 @@
 # This is the directory that the HTML templates reside in
 TEMPLATES = os.path.join(TRACKER_HOME, 'html')
 
+# Optional: the directory that static files are served from (files with the
+# URL /@@file/<filename>). If this is not defined, then static files are
+# served from the TEMPLATES directory.
+# STATIC_FILES = os.path.join(TRACKER_HOME, 'files')
+
 # A descriptive name for your roundup instance
 TRACKER_NAME = 'Roundup issue tracker'
 

Roundup Issue Tracker: http://roundup-tracker.org/