From dff2f00ffa5e2c86960e547ef9e884c5990fae38 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 10 Sep 2002 03:01:20 +0000 Subject: [PATCH] More cleaning up of configuration, and the "instance" -> "tracker" renaming. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1117 57a73879-2fb5-44c3-a270-3262357dd7e2 --- cgi-bin/roundup.cgi | 27 ++++++++++------- doc/customizing.txt | 29 +++++++++---------- doc/getting_started.txt | 20 ++++++------- doc/installation.txt | 4 +-- doc/upgrading.txt | 9 +++++- frontends/ZRoundup/ZRoundup.py | 6 ++-- frontends/ZRoundup/__init__.py | 6 ++-- roundup/admin.py | 8 ++--- roundup/cgi/client.py | 10 +++---- roundup/cgi/templating.py | 2 +- roundup/mailgw.py | 8 ++--- roundup/roundupdb.py | 18 ++++++------ roundup/scripts/roundup_server.py | 18 ++++++------ roundup/templates/classic/config.py | 14 ++++----- roundup/templates/classic/html/home.classlist | 4 +-- scripts/roundup-reminder | 12 ++++---- test/test_db.py | 8 ++--- test/test_schema.py | 8 ++--- 18 files changed, 110 insertions(+), 101 deletions(-) diff --git a/cgi-bin/roundup.cgi b/cgi-bin/roundup.cgi index 8869383..8032705 100755 --- a/cgi-bin/roundup.cgi +++ b/cgi-bin/roundup.cgi @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup.cgi,v 1.30 2002-09-10 01:07:05 richard Exp $ +# $Id: roundup.cgi,v 1.31 2002-09-10 03:01:17 richard Exp $ # python version check from roundup import version_check @@ -32,7 +32,7 @@ import sys # documented below are set, they _override_ any configuation defaults # given in this file. -# ROUNDUP_INSTANCE_HOMES is a list of instances, in the form +# TRACKER_HOMES is a list of instances, in the form # "NAME=DIRNAME2=DIR2...", where is the directory path # separator (";" on Windows, ":" on Unix). @@ -43,7 +43,7 @@ import sys # used in the code. Higher numbers means more debugging output. # This indicates where the Roundup instance lives -ROUNDUP_INSTANCE_HOMES = { +TRACKER_HOMES = { 'demo': '/var/roundup/instances/demo', } @@ -81,11 +81,16 @@ except: # def checkconfig(): import os, string - global ROUNDUP_INSTANCE_HOMES, LOG + global TRACKER_HOMES, LOG - homes = os.environ.get('ROUNDUP_INSTANCE_HOMES', '') + # see if there's an environment var. ROUNDUP_INSTANCE_HOMES is the + # old name for it. + if os.environ.has_key('ROUNDUP_INSTANCE_HOMES'): + homes = os.environ.get('ROUNDUP_INSTANCE_HOMES') + else: + homes = os.environ.get('TRACKER_HOMES', '') if homes: - ROUNDUP_INSTANCE_HOMES = {} + TRACKER_HOMES = {} for home in string.split(homes, os.pathsep): try: name, dir = string.split(home, '=', 1) @@ -93,7 +98,7 @@ def checkconfig(): # ignore invalid definitions continue if name and dir: - ROUNDUP_INSTANCE_HOMES[name] = dir + TRACKER_HOMES[name] = dir logname = os.environ.get('ROUNDUP_LOG', '') if logname: @@ -129,9 +134,9 @@ def main(out, err): request = RequestWrapper(out) request.path = os.environ.get('PATH_INFO', '/') instance = path[1] - os.environ['INSTANCE_NAME'] = instance + os.environ['TRACKER_NAME'] = instance os.environ['PATH_INFO'] = string.join(path[2:], '/') - if ROUNDUP_INSTANCE_HOMES.has_key(instance): + if TRACKER_HOMES.has_key(instance): # redirect if we need a trailing '/' if len(path) == 2: request.send_response(301) @@ -141,7 +146,7 @@ def main(out, err): request.end_headers() out.write('Moved Permanently') else: - instance_home = ROUNDUP_INSTANCE_HOMES[instance] + instance_home = TRACKER_HOMES[instance] instance = roundup.instance.open(instance_home) from roundup.cgi.client import Unauthorised, NotFound client = instance.Client(instance, request, os.environ) @@ -166,7 +171,7 @@ def main(out, err): w = request.write w(_('Roundup instances index\n')) w(_('

Roundup instances index

    \n')) - homes = ROUNDUP_INSTANCE_HOMES.keys() + homes = TRACKER_HOMES.keys() homes.sort() for instance in homes: w(_('
  1. %(instance_name)s\n')%{ diff --git a/doc/customizing.txt b/doc/customizing.txt index 118ec15..00ccea6 100644 --- a/doc/customizing.txt +++ b/doc/customizing.txt @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.24 $ +:Version: $Revision: 1.25 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -57,7 +57,7 @@ The config.py located in your tracker home contains the basic configuration for the web and e-mail components of roundup's interfaces. This file is a Python module. The configuration variables available are: -**INSTANCE_HOME** - ``os.path.split(__file__)[0]`` +**TRACKER_HOME** - ``os.path.split(__file__)[0]`` The tracker home directory. The above default code will automatically determine the tracker home for you. @@ -67,23 +67,23 @@ file is a Python module. The configuration variables available are: **MAIL_DOMAIN** - ``'your.tracker.email.domain.example'`` The domain name used for email addresses. -**DATABASE** - ``os.path.join(INSTANCE_HOME, 'db')`` +**DATABASE** - ``os.path.join(TRACKER_HOME, 'db')`` This is the directory that the database is going to be stored in. By default it is in the tracker home. -**TEMPLATES** - ``os.path.join(INSTANCE_HOME, 'html')`` +**TEMPLATES** - ``os.path.join(TRACKER_HOME, 'html')`` This is the directory that the HTML templates reside in. By default they are in the tracker home. -**INSTANCE_NAME** - ``'Roundup issue tracker'`` +**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. -**ISSUE_TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN`` +**TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN`` The email address that e-mail sent to roundup should go to. Think of it as the tracker's personal e-mail address. -**ISSUE_TRACKER_WEB** - ``'http://your.tracker.url.example/'`` +**TRACKER_WEB** - ``'http://your.tracker.url.example/'`` The web address that the tracker is viewable at. This will be included in information sent to users of the tracker. @@ -126,7 +126,7 @@ can see, the MAIL_DOMAIN must be edited before any interaction with the tracker is attempted.:: # roundup home is this package's directory - INSTANCE_HOME=os.path.split(__file__)[0] + TRACKER_HOME=os.path.split(__file__)[0] # The SMTP mail host that roundup will use to send mail MAILHOST = 'localhost' @@ -135,26 +135,23 @@ tracker is attempted.:: MAIL_DOMAIN = 'your.tracker.email.domain.example' # This is the directory that the database is going to be stored in - DATABASE = os.path.join(INSTANCE_HOME, 'db') + DATABASE = os.path.join(TRACKER_HOME, 'db') # This is the directory that the HTML templates reside in - TEMPLATES = os.path.join(INSTANCE_HOME, 'html') + TEMPLATES = os.path.join(TRACKER_HOME, 'html') # A descriptive name for your roundup tracker - INSTANCE_NAME = 'Roundup issue tracker' + TRACKER_NAME = 'Roundup issue tracker' # The email address that mail to roundup should go to - ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN + TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN # The web address that the tracker is viewable at - ISSUE_TRACKER_WEB = 'http://your.tracker.url.example/' + TRACKER_WEB = 'http://your.tracker.url.example/' # The email address that roundup will complain to if it runs into trouble ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN - # Somewhere for roundup to log stuff internally sent to stdout or stderr - LOG = os.path.join(INSTANCE_HOME, 'roundup.log') - # Send nosy messages to the author of the message MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' diff --git a/doc/getting_started.txt b/doc/getting_started.txt index d58bbea..689967a 100644 --- a/doc/getting_started.txt +++ b/doc/getting_started.txt @@ -2,7 +2,7 @@ Getting Started =============== -:Version: $Revision: 1.6 $ +:Version: $Revision: 1.7 $ .. contents:: @@ -62,12 +62,12 @@ MAILHOST The SMTP mail host that roundup will use to send mail MAIL_DOMAIN The domain name used for email addresses -ISSUE_TRACKER_WEB +TRACKER_WEB The web address of the issue tracker's web interface The email addresses used by the system by default are: -ISSUE_TRACKER_EMAIL: ``issue_tracker@MAIL_DOMAIN`` +TRACKER_EMAIL: ``issue_tracker@MAIL_DOMAIN`` submissions of issues ADMIN_EMAIL: ``roundup-admin@MAIL_DOMAIN`` @@ -136,21 +136,21 @@ Web Interface This software will work through apache or stand-alone. Stand-alone: - 1. Edit roundup-server at the top - ``ROUNDUP_INSTANCE_HOMES`` needs to know + 1. Edit roundup-server at the top - ``TRACKER_HOMES`` needs to know about your tracker. You may also specify the values for - ``ROUNDUP_INSTANCE_HOMES`` on the command-line using "name=home" pairs. + ``TRACKER_HOMES`` on the command-line using "name=home" pairs. 2. "``roundup-server [-p port] (name=tracker_home)*``" (hostname may be "") 3. Load up the page "``//index``" where tracker name is the name - you nominated in ``ROUNDUP_INSTANCE_HOMES``. + you nominated in ``TRACKER_HOMES``. Apache: 1. The CGI script is found in the cgi-bin directory of the roundup distribution. 2. Make sure roundup.cgi is executable. Edit it at the top - - ``ROUNDUP_INSTANCE_HOMES`` needs to know about your tracker. + ``TRACKER_HOMES`` needs to know about your tracker. 3. Edit your "``/etc/httpd/conf/httpd.conf``" and make sure that the "``/home/httpd/html/roundup/roundup.cgi``" script will be treated as a CGI script. @@ -158,13 +158,13 @@ Apache: 4. Re-start your apache to re-load the config if necessary. 5. Load up the page "``/roundup/roundup.cgi/index/``" where tracker name is the - name you nominated in ``ROUNDUP_INSTANCE_HOMES``. + name you nominated in ``TRACKER_HOMES``. 6. To use the CGI script unchanged, which allows much easier updates, add these directives to your "httpd.conf":: SetEnv ROUNDUP_LOG "/var/log/roundup.log" - SetEnv ROUNDUP_INSTANCE_HOMES "Default=/usr/local/share/roundup/trackers/Default" + SetEnv TRACKER_HOMES "Default=/usr/local/share/roundup/trackers/Default" SetEnv ROUNDUP_DEBUG "0" 7. On Windows, write a batch file "roundup.bat" similar to the one below and @@ -172,7 +172,7 @@ Apache: @echo off set ROUNDUP_LOG=c:\Python21\share\roundup\cgi.log - set ROUNDUP_INSTANCE_HOMES=Default=c:\Python21\share\roundup\trackers\Default; + set TRACKER_HOMES=Default=c:\Python21\share\roundup\trackers\Default; set ROUNDUP_DEBUG=0 c:\Python21\python.exe c:\Python21\share\roundup\cgi-bin\roundup.cgi diff --git a/doc/installation.txt b/doc/installation.txt index b9f05ad..a39595c 100644 --- a/doc/installation.txt +++ b/doc/installation.txt @@ -2,7 +2,7 @@ Installing Roundup ================== -:Version: $Revision: 1.22 $ +:Version: $Revision: 1.23 $ .. contents:: @@ -240,7 +240,7 @@ ZRoundup Install roundup as usual (see installation_). ZRoundup installs as a regular Zope product. Copy the ZRoundup directory to -your Products directory either in an INSTANCE_HOME/Products or the Zope +your Products directory either in an TRACKER_HOME/Products or the Zope code tree lib/python/Products. You will need to create the tracker using the roundup-admin tool (step 2 in diff --git a/doc/upgrading.txt b/doc/upgrading.txt index 13f4613..7e69366 100644 --- a/doc/upgrading.txt +++ b/doc/upgrading.txt @@ -89,6 +89,13 @@ Registration" and/or the "Email Registration" Permission from the "Anonymous" Role. See the section on customising security in the `customisation documentation`_ for more information. +Finally, the following config variables have been renamed to make more sense: + +- INSTANCE_HOME -> TRACKER_HOME +- INSTANCE_NAME -> TRACKER_NAME +- ISSUE_TRACKER_WEB -> TRACKER_WEB +- ISSUE_TRACKER_EMAIL -> TRACKER_EMAIL + 0.5.0 Schema Specification -------------------------- @@ -594,7 +601,7 @@ to:: 0.4.0 Configuration -------------------- -``INSTANCE_NAME`` and ``EMAIL_SIGNATURE_POSITION`` have been added to the +``TRACKER_NAME`` and ``EMAIL_SIGNATURE_POSITION`` have been added to the instance_config.py. The simplest solution is to copy the default values from template in the core source. diff --git a/frontends/ZRoundup/ZRoundup.py b/frontends/ZRoundup/ZRoundup.py index f97572f..6afbf73 100644 --- a/frontends/ZRoundup/ZRoundup.py +++ b/frontends/ZRoundup/ZRoundup.py @@ -14,7 +14,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: ZRoundup.py,v 1.12 2002-09-10 01:07:05 richard Exp $ +# $Id: ZRoundup.py,v 1.13 2002-09-10 03:01:18 richard Exp $ # ''' ZRoundup module - exposes the roundup web interface to Zope @@ -135,12 +135,12 @@ class ZRoundup(Item, PropertyManager, Implicit, Persistent): # special case when roundup is '/' in this virtual host, if path == "/" : env['SCRIPT_NAME'] = "/" - env['INSTANCE_NAME'] = '' + env['TRACKER_NAME'] = '' else : # all but the last element is the path env['SCRIPT_NAME'] = '/'.join( path_components[:-1] ) # the last element is the name - env['INSTANCE_NAME'] = path_components[-1] + env['TRACKER_NAME'] = path_components[-1] if env['REQUEST_METHOD'] == 'GET': # force roundup to re-parse the request because Zope fiddles diff --git a/frontends/ZRoundup/__init__.py b/frontends/ZRoundup/__init__.py index c61cf68..5b6f686 100644 --- a/frontends/ZRoundup/__init__.py +++ b/frontends/ZRoundup/__init__.py @@ -14,15 +14,15 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: __init__.py,v 1.2 2002-09-10 01:07:05 richard Exp $ +# $Id: __init__.py,v 1.3 2002-09-10 03:01:18 richard Exp $ # __version__='1.0' import os # figure where ZRoundup is installed here = None -if os.environ.has_key('INSTANCE_HOME'): - here = os.environ['INSTANCE_HOME'] +if os.environ.has_key('TRACKER_HOME'): + here = os.environ['TRACKER_HOME'] path = os.path.join(here, 'Products', 'ZRoundup') if not os.path.exists(path): path = os.path.join(here, 'lib', 'python', 'Products', 'ZRoundup') diff --git a/roundup/admin.py b/roundup/admin.py index cfa2ca4..fd9d9fd 100644 --- a/roundup/admin.py +++ b/roundup/admin.py @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: admin.py,v 1.25 2002-09-10 00:18:20 richard Exp $ +# $Id: admin.py,v 1.26 2002-09-10 03:01:18 richard Exp $ import sys, os, getpass, getopt, re, UserDict, shlex, shutil try: @@ -140,7 +140,7 @@ All commands (except help) require an instance specifier. This is just the path to the roundup instance you're working with. A roundup instance is where roundup keeps the database and configuration file that defines an issue tracker. It may be thought of as the issue tracker's "home directory". It may -be specified in the environment variable ROUNDUP_INSTANCE or on the command +be specified in the environment variable TRACKER_HOME or on the command line as "-i instance". A designator is a classname and a nodeid concatenated, eg. bug1, user10, ... @@ -254,7 +254,7 @@ Command help: Install a new Roundup instance. The command will prompt for the instance home directory (if not supplied - through INSTANCE_HOME or the -i option). The template, backend and admin + through TRACKER_HOME or the -i option). The template, backend and admin password may be specified on the command-line as arguments, in that order. @@ -1112,7 +1112,7 @@ Date format is "YYYY-MM-DD" eg: return 1 # handle command-line args - self.instance_home = os.environ.get('ROUNDUP_INSTANCE', '') + self.instance_home = os.environ.get('TRACKER_HOME', '') # TODO: reinstate the user/password stuff (-u arg too) name = password = '' if os.environ.has_key('ROUNDUP_LOGIN'): diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 2648144..06bff93 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.25 2002-09-09 23:55:19 richard Exp $ +# $Id: client.py,v 1.26 2002-09-10 03:01:18 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -76,7 +76,7 @@ class Client: self.path = env['PATH_INFO'] self.split_path = self.path.split('/') - self.instance_path_name = env['INSTANCE_NAME'] + self.instance_path_name = env['TRACKER_NAME'] # this is the base URL for this instance url = self.env['SCRIPT_NAME'] + '/' + self.instance_path_name @@ -431,7 +431,7 @@ class Client: expire = Cookie._getdate(86400*365) # generate the cookie path - make sure it has a trailing '/' - path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], + path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], '')) self.header({'Set-Cookie': 'roundup_user_2=%s; expires=%s; Path=%s;'%( self.session, expire, path)}) @@ -452,7 +452,7 @@ class Client: # construct the logout cookie now = Cookie._getdate() - path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], + path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], '')) self.header({'Set-Cookie': 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, @@ -528,7 +528,7 @@ class Client: # construct the logout cookie now = Cookie._getdate() - path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], + path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], '')) self.header(headers={'Set-Cookie': 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index eaeb6de..904ee97 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -1104,7 +1104,7 @@ class HTMLRequest: def description(self): ''' Return a description of the request - handle for the page title. ''' - s = [self.client.db.config.INSTANCE_NAME] + s = [self.client.db.config.TRACKER_NAME] if self.classname: if self.client.nodeid: s.append('- %s%s'%(self.classname, self.client.nodeid)) diff --git a/roundup/mailgw.py b/roundup/mailgw.py index 26b66dc..50e3cbe 100644 --- a/roundup/mailgw.py +++ b/roundup/mailgw.py @@ -73,7 +73,7 @@ are calling the create() method to create a new node). If an auditor raises an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.84 2002-09-10 02:37:27 richard Exp $ +$Id: mailgw.py,v 1.85 2002-09-10 03:01:18 richard Exp $ ''' import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri @@ -239,8 +239,8 @@ class MailGW: msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject) - writer.addheader('From', '%s <%s>'% (self.instance.config.INSTANCE_NAME, - self.instance.config.ISSUE_TRACKER_EMAIL)) + writer.addheader('From', '%s <%s>'% (self.instance.config.TRACKER_NAME, + self.instance.config.TRACKER_EMAIL)) writer.addheader('To', ','.join(sendto)) writer.addheader('MIME-Version', '1.0') part = writer.startmultipartbody('mixed') @@ -561,7 +561,7 @@ Unknown address: %s # now update the recipients list recipients = [] - tracker_email = self.instance.config.ISSUE_TRACKER_EMAIL.lower() + tracker_email = self.instance.config.TRACKER_EMAIL.lower() for recipient in message.getaddrlist('to') + message.getaddrlist('cc'): r = recipient[1].strip().lower() if r == tracker_email or not r: diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 9af9735..1baf624 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.65 2002-09-10 02:37:28 richard Exp $ +# $Id: roundupdb.py,v 1.66 2002-09-10 03:01:18 richard Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -214,10 +214,10 @@ class IssueClass: writer.addheader('Subject', '[%s%s] %s'%(cn, nodeid, title)) writer.addheader('To', ', '.join(sendto)) writer.addheader('From', straddr( - (authname, self.db.config.ISSUE_TRACKER_EMAIL) ) ) + (authname, self.db.config.TRACKER_EMAIL) ) ) writer.addheader('Reply-To', straddr( - (self.db.config.INSTANCE_NAME, - self.db.config.ISSUE_TRACKER_EMAIL) ) ) + (self.db.config.TRACKER_NAME, + self.db.config.TRACKER_EMAIL) ) ) writer.addheader('MIME-Version', '1.0') if messageid: writer.addheader('Message-Id', messageid) @@ -225,7 +225,7 @@ class IssueClass: writer.addheader('In-Reply-To', inreplyto) # add a uniquely Roundup header to help filtering - writer.addheader('X-Roundup-Name', self.db.config.INSTANCE_NAME) + writer.addheader('X-Roundup-Name', self.db.config.TRACKER_NAME) # attach files if message_files: @@ -288,17 +288,17 @@ class IssueClass: # simplistic check to see if the url is valid, # then append a trailing slash if it is missing - base = self.db.config.ISSUE_TRACKER_WEB + base = self.db.config.TRACKER_WEB if not isinstance(base , type('')) or not base.startswith('http://'): - base = "Configuration Error: ISSUE_TRACKER_WEB isn't a " \ + base = "Configuration Error: TRACKER_WEB isn't a " \ "fully-qualified URL" elif base[-1] != '/' : base += '/' web = base + 'issue'+ nodeid # ensure the email address is properly quoted - email = straddr((self.db.config.INSTANCE_NAME, - self.db.config.ISSUE_TRACKER_EMAIL)) + email = straddr((self.db.config.TRACKER_NAME, + self.db.config.TRACKER_EMAIL)) line = '_' * max(len(web), len(email)) return '%s\n%s\n%s\n%s'%(line, email, web, line) diff --git a/roundup/scripts/roundup_server.py b/roundup/scripts/roundup_server.py index d8060ca..5b53a0d 100644 --- a/roundup/scripts/roundup_server.py +++ b/roundup/scripts/roundup_server.py @@ -16,7 +16,7 @@ # """ HTTP Server that serves roundup. -$Id: roundup_server.py,v 1.9 2002-09-10 01:07:06 richard Exp $ +$Id: roundup_server.py,v 1.10 2002-09-10 03:01:19 richard Exp $ """ # python version check @@ -35,7 +35,7 @@ from roundup.i18n import _ # # This indicates where the Roundup instance lives -ROUNDUP_INSTANCE_HOMES = { +TRACKER_HOMES = { 'bar': '/tmp/bar', } @@ -57,7 +57,7 @@ ROUNDUP_USER = None class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): - ROUNDUP_INSTANCE_HOMES = ROUNDUP_INSTANCE_HOMES + TRACKER_HOMES = TRACKER_HOMES ROUNDUP_USER = ROUNDUP_USER def run_cgi(self): @@ -101,7 +101,7 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): w = self.wfile.write w(_('Roundup instances index\n')) w(_('

    Roundup instances index

      \n')) - for instance in self.ROUNDUP_INSTANCE_HOMES.keys(): + for instance in self.TRACKER_HOMES.keys(): w(_('
    1. %(instance_name)s\n')%{ 'instance_url': urllib.quote(instance), 'instance_name': cgi.escape(instance)}) @@ -123,8 +123,8 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): return self.index() l_path = rest.split('/') instance_name = urllib.unquote(l_path[1]) - if self.ROUNDUP_INSTANCE_HOMES.has_key(instance_name): - instance_home = self.ROUNDUP_INSTANCE_HOMES[instance_name] + if self.TRACKER_HOMES.has_key(instance_name): + instance_home = self.TRACKER_HOMES[instance_name] instance = roundup.instance.open(instance_home) else: raise client.NotFound @@ -137,7 +137,7 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): # Set up the CGI environment env = {} - env['INSTANCE_NAME'] = instance_name + env['TRACKER_NAME'] = instance_name env['REQUEST_METHOD'] = self.command env['PATH_INFO'] = urllib.unquote(rest) if query: @@ -181,7 +181,7 @@ roundup-server [-n hostname] [-p port] [-l file] [-d file] [name=instance home]* instance home is the directory that was identified when you did "roundup-admin init". You may specify any number of these name=home pairs on the command-line. For convenience, you may edit the - ROUNDUP_INSTANCE_HOMES variable in the roundup-server file instead. + TRACKER_HOMES variable in the roundup-server file instead. ''')%locals() sys.exit(0) @@ -269,7 +269,7 @@ def run(): except ValueError: raise ValueError, _("Instances must be name=home") d[name] = home - RoundupRequestHandler.ROUNDUP_INSTANCE_HOMES = d + RoundupRequestHandler.TRACKER_HOMES = d except SystemExit: raise except: diff --git a/roundup/templates/classic/config.py b/roundup/templates/classic/config.py index 29c0b36..bccd376 100644 --- a/roundup/templates/classic/config.py +++ b/roundup/templates/classic/config.py @@ -15,12 +15,12 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: config.py,v 1.1 2002-09-09 23:56:03 richard Exp $ +# $Id: config.py,v 1.2 2002-09-10 03:01:19 richard Exp $ import os # roundup home is this package's directory -INSTANCE_HOME=os.path.split(__file__)[0] +TRACKER_HOME=os.path.split(__file__)[0] # The SMTP mail host that roundup will use to send mail MAILHOST = 'localhost' @@ -29,19 +29,19 @@ MAILHOST = 'localhost' MAIL_DOMAIN = 'your.tracker.email.domain.example' # This is the directory that the database is going to be stored in -DATABASE = os.path.join(INSTANCE_HOME, 'db') +DATABASE = os.path.join(TRACKER_HOME, 'db') # This is the directory that the HTML templates reside in -TEMPLATES = os.path.join(INSTANCE_HOME, 'html') +TEMPLATES = os.path.join(TRACKER_HOME, 'html') # A descriptive name for your roundup instance -INSTANCE_NAME = 'Roundup issue tracker' +TRACKER_NAME = 'Roundup issue tracker' # The email address that mail to roundup should go to -ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN +TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN # The web address that the instance is viewable at -ISSUE_TRACKER_WEB = 'http://your.tracker.url.example/' +TRACKER_WEB = 'http://your.tracker.url.example/' # The email address that roundup will complain to if it runs into trouble ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN diff --git a/roundup/templates/classic/html/home.classlist b/roundup/templates/classic/html/home.classlist index 2eb1304..6be69de 100644 --- a/roundup/templates/classic/html/home.classlist +++ b/roundup/templates/classic/html/home.classlist @@ -8,8 +8,8 @@ - name - type + name + type diff --git a/scripts/roundup-reminder b/scripts/roundup-reminder index ad7ca42..8bc9576 100755 --- a/scripts/roundup-reminder +++ b/scripts/roundup-reminder @@ -19,7 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# $Id: roundup-reminder,v 1.3 2002-09-10 01:07:06 richard Exp $ +# $Id: roundup-reminder,v 1.4 2002-09-10 03:01:19 richard Exp $ ''' Simple script that emails all users of a tracker with the issues that @@ -73,14 +73,14 @@ for user_id in db.user.list(): # generate the email message message = cStringIO.StringIO() writer = MimeWriter.MimeWriter(message) - writer.addheader('Subject', 'Your active %s issues'%db.config.INSTANCE_NAME) + writer.addheader('Subject', 'Your active %s issues'%db.config.TRACKER_NAME) writer.addheader('To', address) - writer.addheader('From', '%s <%s>'%(db.config.INSTANCE_NAME, + writer.addheader('From', '%s <%s>'%(db.config.TRACKER_NAME, db.config.ADMIN_EMAIL)) - writer.addheader('Reply-To', '%s <%s>'%(db.config.INSTANCE_NAME, + writer.addheader('Reply-To', '%s <%s>'%(db.config.TRACKER_NAME, db.config.ADMIN_EMAIL)) writer.addheader('MIME-Version', '1.0') - writer.addheader('X-Roundup-Name', db.config.INSTANCE_NAME) + writer.addheader('X-Roundup-Name', db.config.TRACKER_NAME) # start the multipart part = writer.startmultipartbody('alternative') @@ -110,7 +110,7 @@ To view or respond to any of the issues listed above, visit the URL %s and click on "My Issues". Do NOT respond to this message. -'''%db.config.ISSUE_TRACKER_WEB +'''%db.config.TRACKER_WEB # now the HTML one diff --git a/test/test_db.py b/test/test_db.py index d935760..4edb232 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_db.py,v 1.43 2002-09-10 00:19:54 richard Exp $ +# $Id: test_db.py,v 1.44 2002-09-10 03:01:20 richard Exp $ import unittest, os, shutil, time @@ -54,9 +54,9 @@ class config: DATABASE='_test_dir' MAILHOST = 'localhost' MAIL_DOMAIN = 'fill.me.in.' - INSTANCE_NAME = 'Roundup issue tracker' - ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN - ISSUE_TRACKER_WEB = 'http://some.useful.url/' + TRACKER_NAME = 'Roundup issue tracker' + TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN + TRACKER_WEB = 'http://some.useful.url/' ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN FILTER_POSITION = 'bottom' # one of 'top', 'bottom', 'top and bottom' ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow' diff --git a/test/test_schema.py b/test/test_schema.py index f124282..44aea25 100644 --- a/test/test_schema.py +++ b/test/test_schema.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_schema.py,v 1.9 2002-09-10 00:19:55 richard Exp $ +# $Id: test_schema.py,v 1.10 2002-09-10 03:01:20 richard Exp $ import unittest, os, shutil @@ -27,9 +27,9 @@ class config: DATABASE='_test_dir' MAILHOST = 'localhost' MAIL_DOMAIN = 'fill.me.in.' - INSTANCE_NAME = 'Roundup issue tracker' - ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN - ISSUE_TRACKER_WEB = 'http://some.useful.url/' + NSTANCE_NAME = 'Roundup issue tracker' + TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN + TRACKER_WEB = 'http://some.useful.url/' ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN FILTER_POSITION = 'bottom' # one of 'top', 'bottom', 'top and bottom' ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow' -- 2.30.2