comparison roundup/scripts/roundup_mailgw.py @ 2671:1154e7fa2f47 maint-0.7

mailgw can override the MAIL_DEFUALT_CLASS
author Richard Jones <richard@users.sourceforge.net>
date Tue, 14 Sep 2004 22:03:43 +0000
parents b48fcae8b2ad
children
comparison
equal deleted inserted replaced
2669:42f69daa70b2 2671:1154e7fa2f47
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.15.2.1 2004-05-28 01:03:53 richard Exp $ 17 # $Id: roundup_mailgw.py,v 1.15.2.2 2004-09-14 22:03:43 richard 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
30 from roundup.i18n import _ 30 from roundup.i18n import _
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 _('Usage: %(program)s [-v] [[-C class] -S field=value]* <instance ' 35 print _('Usage: %(program)s [-v] [-c] [[-C class] -S field=value]* '
36 'home> [method]')%{'program': args[0]} 36 '<instance home> [method]')%{'program': args[0]}
37 print _(''' 37 print _('''
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 / -S: see below 41 -C / -S: see below
41 42
42 The roundup mail gateway may be called in one of four ways: 43 The roundup mail gateway may be called in one of four ways:
43 . with an instance home as the only argument, 44 . with an instance home as the only argument,
44 . with both an instance home and a mail spool file, or 45 . with both an instance home and a mail spool file, or
101 '''Handle the arguments to the program and initialise environment. 102 '''Handle the arguments to the program and initialise environment.
102 ''' 103 '''
103 # take the argv array and parse it leaving the non-option 104 # take the argv array and parse it leaving the non-option
104 # arguments in the args array. 105 # arguments in the args array.
105 try: 106 try:
106 optionsList, args = getopt.getopt(argv[1:], 'vC:S:', ['set=', 107 optionsList, args = getopt.getopt(argv[1:], 'vc:C:S:', ['set=',
107 'class=']) 108 'class='])
108 except getopt.GetoptError: 109 except getopt.GetoptError:
109 # print help information and exit: 110 # print help information and exit:
110 usage(argv) 111 usage(argv)
111 sys.exit(2) 112 sys.exit(2)

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