Skip to content

Commit 571593e

Browse files
author
Richard Jones
committed
version info in scripts
1 parent b691b58 commit 571593e

File tree

7 files changed

+33
-15
lines changed

7 files changed

+33
-15
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Fixed:
2020
- all uses of TRACKER_WEB now ensure it ends with a '/'
2121
- roundup-admin install checks for existing tracker in target home
2222
- grouping (and sorting) by multilink in RDBMS backends (sf bug 655702)
23+
- roundup scripts may now be asked for their version (sf rfe 798657)
2324

2425

2526
2004-03-27 0.7.0b2

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.71 $
5+
:Version: $Revision: 1.72 $
66

77
.. contents::
88

@@ -499,7 +499,7 @@ addresses, databases to back up, etc.
499499
a new property to your issues called Product, and filter by that. See
500500
the customisation example `adding a new field to the classic schema`_.
501501
2. Do you want to track internal software development issues and customer
502-
support issues separately? You can just set up an additiona "issue"
502+
support issues separately? You can just set up an additional "issue"
503503
class called "cust_issues" in the same tracker, mimicing the normal
504504
"issue" class, but with different properties. See the customisation
505505
example `tracking different types of issues`_.

roundup/admin.py

Lines changed: 5 additions & 2 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.66 2004-04-05 06:24:06 richard Exp $
19+
# $Id: admin.py,v 1.67 2004-04-05 23:43:03 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -1314,7 +1314,7 @@ def interactive(self):
13141314

13151315
def main(self):
13161316
try:
1317-
opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:')
1317+
opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v')
13181318
except getopt.GetoptError, e:
13191319
self.usage(str(e))
13201320
return 1
@@ -1334,6 +1334,9 @@ def main(self):
13341334
if opt == '-h':
13351335
self.usage()
13361336
return 0
1337+
if opt == '-v':
1338+
print '%s (python %s)'%(roundup_version, sys.version.split()[0])
1339+
return 0
13371340
if opt == '-i':
13381341
self.tracker_home = arg
13391342
if opt == '-c':

roundup/backends/__init__.py

Lines changed: 3 additions & 3 deletions
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: __init__.py,v 1.26 2004-02-11 23:55:08 richard Exp $
18+
# $Id: __init__.py,v 1.27 2004-04-05 23:43:03 richard Exp $
1919

2020
'''Container for the hyperdb storage backend implementations.
2121
@@ -26,8 +26,8 @@
2626

2727
__all__ = []
2828

29-
for backend in ['anydbm', ('mysql', 'MySQLdb'), 'bsddb', 'bsddb3', 'sqlite',
30-
'metakit', ('postgresql', 'psycopg')]:
29+
for backend in ['anydbm', ('mysql', 'MySQLdb'), ('bsddb', '_bsddb'),
30+
'bsddb3', 'sqlite', 'metakit', ('postgresql', 'psycopg')]:
3131
if len(backend) == 2:
3232
backend, backend_module = backend
3333
else:

roundup/scripts/roundup_mailgw.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: roundup_mailgw.py,v 1.11 2004-02-11 23:55:10 richard Exp $
17+
# $Id: roundup_mailgw.py,v 1.12 2004-04-05 23:43:03 richard Exp $
1818

1919
"""Command-line script stub that calls the roundup.mailgw.
2020
"""
2121
__docformat__ = 'restructuredtext'
2222

2323
# python version check
2424
from roundup import version_check
25+
from roundup import __version__ as roundup_version
2526

2627
import sys, os, re, cStringIO, getopt
2728

@@ -31,9 +32,12 @@
3132
def usage(args, message=None):
3233
if message is not None:
3334
print message
34-
print _('Usage: %(program)s [[-C class] -S field=value]* <instance '
35+
print _('Usage: %(program)s [-v] [[-C class] -S field=value]* <instance '
3536
'home> [method]')%{'program': args[0]}
3637
print _('''
38+
Options:
39+
-v: print version and exit
40+
-C / -S: see below
3741
3842
The roundup mail gateway may be called in one of three ways:
3943
. with an instance home as the only argument,
@@ -85,12 +89,17 @@ def main(argv):
8589
# take the argv array and parse it leaving the non-option
8690
# arguments in the args array.
8791
try:
88-
optionsList, args = getopt.getopt(argv[1:], 'C:S:', ['set=', 'class='])
92+
optionsList, args = getopt.getopt(argv[1:], 'vC:S:', ['set=', 'class='])
8993
except getopt.GetoptError:
9094
# print help information and exit:
9195
usage(argv)
9296
sys.exit(2)
9397

98+
for (opt, arg) in optionsList:
99+
if opt == '-v':
100+
print '%s (python %s)'%(roundup_version, sys.version.split()[0])
101+
return
102+
94103
# figure the instance home
95104
if len(args) > 0:
96105
instance_home = args[0]

roundup/scripts/roundup_server.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717

1818
"""Command-line script that runs a server over roundup.cgi.client.
1919
20-
$Id: roundup_server.py,v 1.42 2004-04-05 00:54:23 richard Exp $
20+
$Id: roundup_server.py,v 1.43 2004-04-05 23:43:04 richard Exp $
2121
"""
2222
__docformat__ = 'restructuredtext'
2323

2424
# python version check
2525
from roundup import version_check
26+
from roundup import __version__ as roundup_version
2627

2728
import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt, imp
2829
import BaseHTTPServer, socket, errno
@@ -350,6 +351,7 @@ def usage(message=''):
350351
roundup-server [options] [name=tracker home]*
351352
352353
options:
354+
-v: print version and exit
353355
-n: sets the host name
354356
-p: sets the port to listen on (default: %(port)s)
355357
-u: sets the uid to this user after listening on the port
@@ -397,9 +399,9 @@ def daemonize(pidfile):
397399
pidfile = open(pidfile, 'w')
398400
pidfile.write(str(pid))
399401
pidfile.close()
400-
os._exit(0)
402+
os._exit(0)
401403

402-
os.chdir("/")
404+
os.chdir("/")
403405
os.umask(0)
404406

405407
# close off sys.std(in|out|err), redirect to devnull so the file
@@ -426,7 +428,7 @@ def run(port=PORT, success_message=None):
426428

427429
try:
428430
# handle the command-line args
429-
options = 'n:p:u:d:l:hN'
431+
options = 'n:p:u:d:l:hNv'
430432
if RoundupService:
431433
options += 'c'
432434

@@ -439,6 +441,9 @@ def run(port=PORT, success_message=None):
439441
group = None
440442
for (opt, arg) in optlist:
441443
if opt == '-n': hostname = arg
444+
elif opt == '-v':
445+
print '%s (python %s)'%(roundup_version, sys.version.split()[0])
446+
return
442447
elif opt == '-p': port = int(arg)
443448
elif opt == '-u': user = arg
444449
elif opt == '-g': group = arg

test/test_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def assertRaisesMessage(self, exception, callable, message, *args,
5757
raise self.failureException, excName
5858

5959
def testShowAction(self):
60-
self.client.db.config.TRACKER_WEB = 'BASE/'
60+
self.client.base = 'BASE/'
6161

6262
action = ShowAction(self.client)
6363
self.assertRaises(ValueError, action.handle)

0 commit comments

Comments
 (0)