Skip to content

Commit 868bb38

Browse files
author
Richard Jones
committed
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
1 parent 3171b49 commit 868bb38

File tree

18 files changed

+110
-101
lines changed

18 files changed

+110
-101
lines changed

cgi-bin/roundup.cgi

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup.cgi,v 1.30 2002-09-10 01:07:05 richard Exp $
19+
# $Id: roundup.cgi,v 1.31 2002-09-10 03:01:17 richard Exp $
2020

2121
# python version check
2222
from roundup import version_check
@@ -32,7 +32,7 @@ import sys
3232
# documented below are set, they _override_ any configuation defaults
3333
# given in this file.
3434

35-
# ROUNDUP_INSTANCE_HOMES is a list of instances, in the form
35+
# TRACKER_HOMES is a list of instances, in the form
3636
# "NAME=DIR<sep>NAME2=DIR2<sep>...", where <sep> is the directory path
3737
# separator (";" on Windows, ":" on Unix).
3838

@@ -43,7 +43,7 @@ import sys
4343
# used in the code. Higher numbers means more debugging output.
4444

4545
# This indicates where the Roundup instance lives
46-
ROUNDUP_INSTANCE_HOMES = {
46+
TRACKER_HOMES = {
4747
'demo': '/var/roundup/instances/demo',
4848
}
4949

@@ -81,19 +81,24 @@ except:
8181
#
8282
def checkconfig():
8383
import os, string
84-
global ROUNDUP_INSTANCE_HOMES, LOG
84+
global TRACKER_HOMES, LOG
8585

86-
homes = os.environ.get('ROUNDUP_INSTANCE_HOMES', '')
86+
# see if there's an environment var. ROUNDUP_INSTANCE_HOMES is the
87+
# old name for it.
88+
if os.environ.has_key('ROUNDUP_INSTANCE_HOMES'):
89+
homes = os.environ.get('ROUNDUP_INSTANCE_HOMES')
90+
else:
91+
homes = os.environ.get('TRACKER_HOMES', '')
8792
if homes:
88-
ROUNDUP_INSTANCE_HOMES = {}
93+
TRACKER_HOMES = {}
8994
for home in string.split(homes, os.pathsep):
9095
try:
9196
name, dir = string.split(home, '=', 1)
9297
except ValueError:
9398
# ignore invalid definitions
9499
continue
95100
if name and dir:
96-
ROUNDUP_INSTANCE_HOMES[name] = dir
101+
TRACKER_HOMES[name] = dir
97102

98103
logname = os.environ.get('ROUNDUP_LOG', '')
99104
if logname:
@@ -129,9 +134,9 @@ def main(out, err):
129134
request = RequestWrapper(out)
130135
request.path = os.environ.get('PATH_INFO', '/')
131136
instance = path[1]
132-
os.environ['INSTANCE_NAME'] = instance
137+
os.environ['TRACKER_NAME'] = instance
133138
os.environ['PATH_INFO'] = string.join(path[2:], '/')
134-
if ROUNDUP_INSTANCE_HOMES.has_key(instance):
139+
if TRACKER_HOMES.has_key(instance):
135140
# redirect if we need a trailing '/'
136141
if len(path) == 2:
137142
request.send_response(301)
@@ -141,7 +146,7 @@ def main(out, err):
141146
request.end_headers()
142147
out.write('Moved Permanently')
143148
else:
144-
instance_home = ROUNDUP_INSTANCE_HOMES[instance]
149+
instance_home = TRACKER_HOMES[instance]
145150
instance = roundup.instance.open(instance_home)
146151
from roundup.cgi.client import Unauthorised, NotFound
147152
client = instance.Client(instance, request, os.environ)
@@ -166,7 +171,7 @@ def main(out, err):
166171
w = request.write
167172
w(_('<html><head><title>Roundup instances index</title></head>\n'))
168173
w(_('<body><h1>Roundup instances index</h1><ol>\n'))
169-
homes = ROUNDUP_INSTANCE_HOMES.keys()
174+
homes = TRACKER_HOMES.keys()
170175
homes.sort()
171176
for instance in homes:
172177
w(_('<li><a href="%(instance_url)s/index">%(instance_name)s</a>\n')%{

doc/customizing.txt

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.24 $
5+
:Version: $Revision: 1.25 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
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
5757
configuration for the web and e-mail components of roundup's interfaces. This
5858
file is a Python module. The configuration variables available are:
5959

60-
**INSTANCE_HOME** - ``os.path.split(__file__)[0]``
60+
**TRACKER_HOME** - ``os.path.split(__file__)[0]``
6161
The tracker home directory. The above default code will automatically
6262
determine the tracker home for you.
6363

@@ -67,23 +67,23 @@ file is a Python module. The configuration variables available are:
6767
**MAIL_DOMAIN** - ``'your.tracker.email.domain.example'``
6868
The domain name used for email addresses.
6969

70-
**DATABASE** - ``os.path.join(INSTANCE_HOME, 'db')``
70+
**DATABASE** - ``os.path.join(TRACKER_HOME, 'db')``
7171
This is the directory that the database is going to be stored in. By default
7272
it is in the tracker home.
7373

74-
**TEMPLATES** - ``os.path.join(INSTANCE_HOME, 'html')``
74+
**TEMPLATES** - ``os.path.join(TRACKER_HOME, 'html')``
7575
This is the directory that the HTML templates reside in. By default they are
7676
in the tracker home.
7777

78-
**INSTANCE_NAME** - ``'Roundup issue tracker'``
78+
**TRACKER_NAME** - ``'Roundup issue tracker'``
7979
A descriptive name for your roundup tracker. This is sent out in e-mails and
8080
appears in the heading of CGI pages.
8181

82-
**ISSUE_TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN``
82+
**TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN``
8383
The email address that e-mail sent to roundup should go to. Think of it as the
8484
tracker's personal e-mail address.
8585

86-
**ISSUE_TRACKER_WEB** - ``'http://your.tracker.url.example/'``
86+
**TRACKER_WEB** - ``'http://your.tracker.url.example/'``
8787
The web address that the tracker is viewable at. This will be included in
8888
information sent to users of the tracker.
8989

@@ -126,7 +126,7 @@ can see, the MAIL_DOMAIN must be edited before any interaction with the
126126
tracker is attempted.::
127127

128128
# roundup home is this package's directory
129-
INSTANCE_HOME=os.path.split(__file__)[0]
129+
TRACKER_HOME=os.path.split(__file__)[0]
130130

131131
# The SMTP mail host that roundup will use to send mail
132132
MAILHOST = 'localhost'
@@ -135,26 +135,23 @@ tracker is attempted.::
135135
MAIL_DOMAIN = 'your.tracker.email.domain.example'
136136

137137
# This is the directory that the database is going to be stored in
138-
DATABASE = os.path.join(INSTANCE_HOME, 'db')
138+
DATABASE = os.path.join(TRACKER_HOME, 'db')
139139

140140
# This is the directory that the HTML templates reside in
141-
TEMPLATES = os.path.join(INSTANCE_HOME, 'html')
141+
TEMPLATES = os.path.join(TRACKER_HOME, 'html')
142142

143143
# A descriptive name for your roundup tracker
144-
INSTANCE_NAME = 'Roundup issue tracker'
144+
TRACKER_NAME = 'Roundup issue tracker'
145145

146146
# The email address that mail to roundup should go to
147-
ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
147+
TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
148148

149149
# The web address that the tracker is viewable at
150-
ISSUE_TRACKER_WEB = 'http://your.tracker.url.example/'
150+
TRACKER_WEB = 'http://your.tracker.url.example/'
151151

152152
# The email address that roundup will complain to if it runs into trouble
153153
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
154154

155-
# Somewhere for roundup to log stuff internally sent to stdout or stderr
156-
LOG = os.path.join(INSTANCE_HOME, 'roundup.log')
157-
158155
# Send nosy messages to the author of the message
159156
MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no'
160157

doc/getting_started.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Getting Started
33
===============
44

5-
:Version: $Revision: 1.6 $
5+
:Version: $Revision: 1.7 $
66

77
.. contents::
88

@@ -62,12 +62,12 @@ MAILHOST
6262
The SMTP mail host that roundup will use to send mail
6363
MAIL_DOMAIN
6464
The domain name used for email addresses
65-
ISSUE_TRACKER_WEB
65+
TRACKER_WEB
6666
The web address of the issue tracker's web interface
6767

6868
The email addresses used by the system by default are:
6969

70-
ISSUE_TRACKER_EMAIL: ``issue_tracker@MAIL_DOMAIN``
70+
TRACKER_EMAIL: ``issue_tracker@MAIL_DOMAIN``
7171
submissions of issues
7272

7373
ADMIN_EMAIL: ``roundup-admin@MAIL_DOMAIN``
@@ -136,43 +136,43 @@ Web Interface
136136
This software will work through apache or stand-alone.
137137

138138
Stand-alone:
139-
1. Edit roundup-server at the top - ``ROUNDUP_INSTANCE_HOMES`` needs to know
139+
1. Edit roundup-server at the top - ``TRACKER_HOMES`` needs to know
140140
about your tracker. You may also specify the values for
141-
``ROUNDUP_INSTANCE_HOMES`` on the command-line using "name=home" pairs.
141+
``TRACKER_HOMES`` on the command-line using "name=home" pairs.
142142

143143
2. "``roundup-server [-p port] (name=tracker_home)*``" (hostname may be "")
144144

145145
3. Load up the page "``/<tracker name>/index``" where tracker name is the name
146-
you nominated in ``ROUNDUP_INSTANCE_HOMES``.
146+
you nominated in ``TRACKER_HOMES``.
147147

148148
Apache:
149149
1. The CGI script is found in the cgi-bin directory of the roundup
150150
distribution.
151151

152152
2. Make sure roundup.cgi is executable. Edit it at the top -
153-
``ROUNDUP_INSTANCE_HOMES`` needs to know about your tracker.
153+
``TRACKER_HOMES`` needs to know about your tracker.
154154

155155
3. Edit your "``/etc/httpd/conf/httpd.conf``" and make sure that the
156156
"``/home/httpd/html/roundup/roundup.cgi``" script will be treated as a CGI script.
157157

158158
4. Re-start your apache to re-load the config if necessary.
159159

160160
5. Load up the page "``/roundup/roundup.cgi/index/``" where tracker name is the
161-
name you nominated in ``ROUNDUP_INSTANCE_HOMES``.
161+
name you nominated in ``TRACKER_HOMES``.
162162

163163
6. To use the CGI script unchanged, which allows much easier updates, add
164164
these directives to your "httpd.conf"::
165165

166166
SetEnv ROUNDUP_LOG "/var/log/roundup.log"
167-
SetEnv ROUNDUP_INSTANCE_HOMES "Default=/usr/local/share/roundup/trackers/Default"
167+
SetEnv TRACKER_HOMES "Default=/usr/local/share/roundup/trackers/Default"
168168
SetEnv ROUNDUP_DEBUG "0"
169169

170170
7. On Windows, write a batch file "roundup.bat" similar to the one below and
171171
place it into your cgi-bin directory::
172172

173173
@echo off
174174
set ROUNDUP_LOG=c:\Python21\share\roundup\cgi.log
175-
set ROUNDUP_INSTANCE_HOMES=Default=c:\Python21\share\roundup\trackers\Default;
175+
set TRACKER_HOMES=Default=c:\Python21\share\roundup\trackers\Default;
176176
set ROUNDUP_DEBUG=0
177177
c:\Python21\python.exe c:\Python21\share\roundup\cgi-bin\roundup.cgi
178178

doc/installation.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Installing Roundup
33
==================
44

5-
:Version: $Revision: 1.22 $
5+
:Version: $Revision: 1.23 $
66

77
.. contents::
88

@@ -240,7 +240,7 @@ ZRoundup
240240
Install roundup as usual (see installation_).
241241

242242
ZRoundup installs as a regular Zope product. Copy the ZRoundup directory to
243-
your Products directory either in an INSTANCE_HOME/Products or the Zope
243+
your Products directory either in an TRACKER_HOME/Products or the Zope
244244
code tree lib/python/Products.
245245

246246
You will need to create the tracker using the roundup-admin tool (step 2 in

doc/upgrading.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ Registration" and/or the "Email Registration" Permission from the "Anonymous"
8989
Role. See the section on customising security in the `customisation
9090
documentation`_ for more information.
9191

92+
Finally, the following config variables have been renamed to make more sense:
93+
94+
- INSTANCE_HOME -> TRACKER_HOME
95+
- INSTANCE_NAME -> TRACKER_NAME
96+
- ISSUE_TRACKER_WEB -> TRACKER_WEB
97+
- ISSUE_TRACKER_EMAIL -> TRACKER_EMAIL
98+
9299

93100
0.5.0 Schema Specification
94101
--------------------------
@@ -594,7 +601,7 @@ to::
594601

595602
0.4.0 Configuration
596603
--------------------
597-
``INSTANCE_NAME`` and ``EMAIL_SIGNATURE_POSITION`` have been added to the
604+
``TRACKER_NAME`` and ``EMAIL_SIGNATURE_POSITION`` have been added to the
598605
instance_config.py. The simplest solution is to copy the default values
599606
from template in the core source.
600607

frontends/ZRoundup/ZRoundup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: ZRoundup.py,v 1.12 2002-09-10 01:07:05 richard Exp $
17+
# $Id: ZRoundup.py,v 1.13 2002-09-10 03:01:18 richard Exp $
1818
#
1919
''' ZRoundup module - exposes the roundup web interface to Zope
2020
@@ -135,12 +135,12 @@ def _opendb(self):
135135
# special case when roundup is '/' in this virtual host,
136136
if path == "/" :
137137
env['SCRIPT_NAME'] = "/"
138-
env['INSTANCE_NAME'] = ''
138+
env['TRACKER_NAME'] = ''
139139
else :
140140
# all but the last element is the path
141141
env['SCRIPT_NAME'] = '/'.join( path_components[:-1] )
142142
# the last element is the name
143-
env['INSTANCE_NAME'] = path_components[-1]
143+
env['TRACKER_NAME'] = path_components[-1]
144144

145145
if env['REQUEST_METHOD'] == 'GET':
146146
# force roundup to re-parse the request because Zope fiddles

frontends/ZRoundup/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: __init__.py,v 1.2 2002-09-10 01:07:05 richard Exp $
17+
# $Id: __init__.py,v 1.3 2002-09-10 03:01:18 richard Exp $
1818
#
1919
__version__='1.0'
2020

2121
import os
2222
# figure where ZRoundup is installed
2323
here = None
24-
if os.environ.has_key('INSTANCE_HOME'):
25-
here = os.environ['INSTANCE_HOME']
24+
if os.environ.has_key('TRACKER_HOME'):
25+
here = os.environ['TRACKER_HOME']
2626
path = os.path.join(here, 'Products', 'ZRoundup')
2727
if not os.path.exists(path):
2828
path = os.path.join(here, 'lib', 'python', 'Products', 'ZRoundup')

roundup/admin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.25 2002-09-10 00:18:20 richard Exp $
19+
# $Id: admin.py,v 1.26 2002-09-10 03:01:18 richard Exp $
2020

2121
import sys, os, getpass, getopt, re, UserDict, shlex, shutil
2222
try:
@@ -140,7 +140,7 @@ def help_all(self):
140140
to the roundup instance you're working with. A roundup instance is where
141141
roundup keeps the database and configuration file that defines an issue
142142
tracker. It may be thought of as the issue tracker's "home directory". It may
143-
be specified in the environment variable ROUNDUP_INSTANCE or on the command
143+
be specified in the environment variable TRACKER_HOME or on the command
144144
line as "-i instance".
145145
146146
A designator is a classname and a nodeid concatenated, eg. bug1, user10, ...
@@ -254,7 +254,7 @@ def do_install(self, instance_home, args):
254254
Install a new Roundup instance.
255255
256256
The command will prompt for the instance home directory (if not supplied
257-
through INSTANCE_HOME or the -i option). The template, backend and admin
257+
through TRACKER_HOME or the -i option). The template, backend and admin
258258
password may be specified on the command-line as arguments, in that
259259
order.
260260
@@ -1112,7 +1112,7 @@ def main(self):
11121112
return 1
11131113

11141114
# handle command-line args
1115-
self.instance_home = os.environ.get('ROUNDUP_INSTANCE', '')
1115+
self.instance_home = os.environ.get('TRACKER_HOME', '')
11161116
# TODO: reinstate the user/password stuff (-u arg too)
11171117
name = password = ''
11181118
if os.environ.has_key('ROUNDUP_LOGIN'):

0 commit comments

Comments
 (0)