comparison roundup/scripts/roundup_mailgw.py @ 3638:22ec8e91da2b

Fix -c option (default class) for roundup-mailgw Fixes [SF#1505649] "-c option for roundup-mailgw won't accept parameter + patch"
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Sat, 15 Jul 2006 10:08:01 +0000
parents 263e8f485db5
children ee73abcc95d2
comparison
equal deleted inserted replaced
3637:31c79e3aa600 3638:22ec8e91da2b
12 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 12 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 13 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
16 # 16 #
17 # $Id: roundup_mailgw.py,v 1.21 2005-07-18 01:19:57 richard Exp $ 17 # $Id: roundup_mailgw.py,v 1.22 2006-07-15 10:08:01 schlatterbeck Exp $
18 18
19 """Command-line script stub that calls the roundup.mailgw. 19 """Command-line script stub that calls the roundup.mailgw.
20 """ 20 """
21 __docformat__ = 'restructuredtext' 21 __docformat__ = 'restructuredtext'
22 22
31 31
32 def usage(args, message=None): 32 def usage(args, message=None):
33 if message is not None: 33 if message is not None:
34 print message 34 print message
35 print _( 35 print _(
36 """Usage: %(program)s [-v] [-c] [[-C class] -S field=value]* <instance home> [method] 36 """Usage: %(program)s [-v] [-c class] [[-C class] -S field=value]* <instance home> [method]
37 37
38 Options: 38 Options:
39 -v: print version and exit 39 -v: print version and exit
40 -c: default class of item to create (else the tracker's MAIL_DEFAULT_CLASS) 40 -c: default class of item to create (else the tracker's MAIL_DEFAULT_CLASS)
41 -C / -S: see below 41 -C / -S: see below
102 '''Handle the arguments to the program and initialise environment. 102 '''Handle the arguments to the program and initialise environment.
103 ''' 103 '''
104 # take the argv array and parse it leaving the non-option 104 # take the argv array and parse it leaving the non-option
105 # arguments in the args array. 105 # arguments in the args array.
106 try: 106 try:
107 optionsList, args = getopt.getopt(argv[1:], 'vcC:S:', ['set=', 107 optionsList, args = getopt.getopt(argv[1:], 'vc:C:S:', ['set=',
108 'class=']) 108 'class='])
109 except getopt.GetoptError: 109 except getopt.GetoptError:
110 # print help information and exit: 110 # print help information and exit:
111 usage(argv) 111 usage(argv)
112 sys.exit(2) 112 sys.exit(2)

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