From ebceedf66795d79ee76ecc869abdcd8e65ac3a81 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 5 Apr 2004 23:43:04 +0000 Subject: [PATCH] version info in scripts git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2257 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + doc/installation.txt | 4 ++-- roundup/admin.py | 7 +++++-- roundup/backends/__init__.py | 6 +++--- roundup/scripts/roundup_mailgw.py | 15 ++++++++++++--- roundup/scripts/roundup_server.py | 13 +++++++++---- test/test_actions.py | 2 +- 7 files changed, 33 insertions(+), 15 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 5f1a1e4..e8b290a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,7 @@ Fixed: - all uses of TRACKER_WEB now ensure it ends with a '/' - roundup-admin install checks for existing tracker in target home - grouping (and sorting) by multilink in RDBMS backends (sf bug 655702) +- roundup scripts may now be asked for their version (sf rfe 798657) 2004-03-27 0.7.0b2 diff --git a/doc/installation.txt b/doc/installation.txt index 6577d1a..17573c1 100644 --- a/doc/installation.txt +++ b/doc/installation.txt @@ -2,7 +2,7 @@ Installing Roundup ================== -:Version: $Revision: 1.71 $ +:Version: $Revision: 1.72 $ .. contents:: @@ -499,7 +499,7 @@ addresses, databases to back up, etc. a new property to your issues called Product, and filter by that. See the customisation example `adding a new field to the classic schema`_. 2. Do you want to track internal software development issues and customer - support issues separately? You can just set up an additiona "issue" + support issues separately? You can just set up an additional "issue" class called "cust_issues" in the same tracker, mimicing the normal "issue" class, but with different properties. See the customisation example `tracking different types of issues`_. diff --git a/roundup/admin.py b/roundup/admin.py index 57a7a0c..2fe8c6f 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.66 2004-04-05 06:24:06 richard Exp $ +# $Id: admin.py,v 1.67 2004-04-05 23:43:03 richard Exp $ '''Administration commands for maintaining Roundup trackers. ''' @@ -1314,7 +1314,7 @@ Date format is "YYYY-MM-DD" eg: def main(self): try: - opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:') + opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v') except getopt.GetoptError, e: self.usage(str(e)) return 1 @@ -1334,6 +1334,9 @@ Date format is "YYYY-MM-DD" eg: if opt == '-h': self.usage() return 0 + if opt == '-v': + print '%s (python %s)'%(roundup_version, sys.version.split()[0]) + return 0 if opt == '-i': self.tracker_home = arg if opt == '-c': diff --git a/roundup/backends/__init__.py b/roundup/backends/__init__.py index ecacacb..0b7ddeb 100644 --- a/roundup/backends/__init__.py +++ b/roundup/backends/__init__.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: __init__.py,v 1.26 2004-02-11 23:55:08 richard Exp $ +# $Id: __init__.py,v 1.27 2004-04-05 23:43:03 richard Exp $ '''Container for the hyperdb storage backend implementations. @@ -26,8 +26,8 @@ __docformat__ = 'restructuredtext' __all__ = [] -for backend in ['anydbm', ('mysql', 'MySQLdb'), 'bsddb', 'bsddb3', 'sqlite', - 'metakit', ('postgresql', 'psycopg')]: +for backend in ['anydbm', ('mysql', 'MySQLdb'), ('bsddb', '_bsddb'), + 'bsddb3', 'sqlite', 'metakit', ('postgresql', 'psycopg')]: if len(backend) == 2: backend, backend_module = backend else: diff --git a/roundup/scripts/roundup_mailgw.py b/roundup/scripts/roundup_mailgw.py index 5b6905c..8695aee 100644 --- a/roundup/scripts/roundup_mailgw.py +++ b/roundup/scripts/roundup_mailgw.py @@ -14,7 +14,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup_mailgw.py,v 1.11 2004-02-11 23:55:10 richard Exp $ +# $Id: roundup_mailgw.py,v 1.12 2004-04-05 23:43:03 richard Exp $ """Command-line script stub that calls the roundup.mailgw. """ @@ -22,6 +22,7 @@ __docformat__ = 'restructuredtext' # python version check from roundup import version_check +from roundup import __version__ as roundup_version import sys, os, re, cStringIO, getopt @@ -31,9 +32,12 @@ from roundup.i18n import _ def usage(args, message=None): if message is not None: print message - print _('Usage: %(program)s [[-C class] -S field=value]* [method]')%{'program': args[0]} print _(''' +Options: + -v: print version and exit + -C / -S: see below The roundup mail gateway may be called in one of three ways: . with an instance home as the only argument, @@ -85,12 +89,17 @@ def main(argv): # take the argv array and parse it leaving the non-option # arguments in the args array. try: - optionsList, args = getopt.getopt(argv[1:], 'C:S:', ['set=', 'class=']) + optionsList, args = getopt.getopt(argv[1:], 'vC:S:', ['set=', 'class=']) except getopt.GetoptError: # print help information and exit: usage(argv) sys.exit(2) + for (opt, arg) in optionsList: + if opt == '-v': + print '%s (python %s)'%(roundup_version, sys.version.split()[0]) + return + # figure the instance home if len(args) > 0: instance_home = args[0] diff --git a/roundup/scripts/roundup_server.py b/roundup/scripts/roundup_server.py index fa32637..c14cdf6 100644 --- a/roundup/scripts/roundup_server.py +++ b/roundup/scripts/roundup_server.py @@ -17,12 +17,13 @@ """Command-line script that runs a server over roundup.cgi.client. -$Id: roundup_server.py,v 1.42 2004-04-05 00:54:23 richard Exp $ +$Id: roundup_server.py,v 1.43 2004-04-05 23:43:04 richard Exp $ """ __docformat__ = 'restructuredtext' # python version check from roundup import version_check +from roundup import __version__ as roundup_version import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt, imp import BaseHTTPServer, socket, errno @@ -350,6 +351,7 @@ Usage: roundup-server [options] [name=tracker home]* options: + -v: print version and exit -n: sets the host name -p: sets the port to listen on (default: %(port)s) -u: sets the uid to this user after listening on the port @@ -397,9 +399,9 @@ def daemonize(pidfile): pidfile = open(pidfile, 'w') pidfile.write(str(pid)) pidfile.close() - os._exit(0) + os._exit(0) - os.chdir("/") + os.chdir("/") os.umask(0) # close off sys.std(in|out|err), redirect to devnull so the file @@ -426,7 +428,7 @@ def run(port=PORT, success_message=None): try: # handle the command-line args - options = 'n:p:u:d:l:hN' + options = 'n:p:u:d:l:hNv' if RoundupService: options += 'c' @@ -439,6 +441,9 @@ def run(port=PORT, success_message=None): group = None for (opt, arg) in optlist: if opt == '-n': hostname = arg + elif opt == '-v': + print '%s (python %s)'%(roundup_version, sys.version.split()[0]) + return elif opt == '-p': port = int(arg) elif opt == '-u': user = arg elif opt == '-g': group = arg diff --git a/test/test_actions.py b/test/test_actions.py index d7a2c91..0728246 100755 --- a/test/test_actions.py +++ b/test/test_actions.py @@ -57,7 +57,7 @@ class ShowActionTestCase(ActionTestCase): raise self.failureException, excName def testShowAction(self): - self.client.db.config.TRACKER_WEB = 'BASE/' + self.client.base = 'BASE/' action = ShowAction(self.client) self.assertRaises(ValueError, action.handle) -- 2.30.2