Code

stupid typo
[roundup.git] / roundup-mailgw
1 #! /usr/bin/python
2 #
3 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
4 # This module is free software, and you may redistribute it and/or modify
5 # under the same terms as Python, so long as this copyright message and
6 # disclaimer are retained in their original form.
7 #
8 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
9 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
10 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
11 # POSSIBILITY OF SUCH DAMAGE.
12 #
13 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18
19 # $Id: roundup-mailgw,v 1.7 2001-08-07 00:24:42 richard Exp $
21 import sys
22 if int(sys.version[0]) < 2:
23     print "Roundup requires Python 2.0 or newer."
24     sys.exit(1)
26 # figure the instance home
27 import os
28 if len(sys.argv) > 1:
29     instance_home = sys.argv[1]
30 else:
31     instance_home = os.environ.get('ROUNDUP_INSTANCE', '')
32 if not instance_home:
33     print 'No instance home specified'
34     sys.exit(1)
36 # get the instance
37 import roundup.instance
38 instance = roundup.instance.open(instance_home)
40 # invokde the mail handler
41 db = instance.open('admin')
42 handler = instance.MailGW(db)
43 handler.main(sys.stdin)
45 #
46 # $Log: not supported by cvs2svn $
47 # Revision 1.6  2001/08/07 00:15:51  richard
48 # Added the copyright/license notice to (nearly) all files at request of
49 # Bizar Software.
50 #
51 # Revision 1.5  2001/08/05 07:44:25  richard
52 # Instances are now opened by a special function that generates a unique
53 # module name for the instances on import time.
54 #
55 # Revision 1.4  2001/08/03 01:28:33  richard
56 # Used the much nicer load_package, pointed out by Steve Majewski.
57 #
58 # Revision 1.3  2001/08/03 00:59:34  richard
59 # Instance import now imports the instance using imp.load_module so that
60 # we can have instance homes of "roundup" or other existing python package
61 # names.
62 #
63 # Revision 1.2  2001/07/29 07:01:39  richard
64 # Added vim command to all source so that we don't get no steenkin' tabs :)
65 #
66 # Revision 1.1  2001/07/23 03:46:48  richard
67 # moving the bin files to facilitate out-of-the-boxness
68 #
69 # Revision 1.1  2001/07/22 11:15:45  richard
70 # More Grande Splite stuff
71 #
72 #
73 # vim: set filetype=python ts=4 sw=4 et si