Mercurial > p > roundup > code
comparison bin/roundup-mailgw @ 23:0eea7628adb2
More Grande Splite stuff
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 22 Jul 2001 11:15:45 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 22:d64c32a499f9 | 23:0eea7628adb2 |
|---|---|
| 1 #! /usr/bin/python | |
| 2 | |
| 3 # $ID: $ | |
| 4 | |
| 5 import sys | |
| 6 if int(sys.version[0]) < 2: | |
| 7 print "Roundup requires Python 2.0 or newer." | |
| 8 sys.exit(1) | |
| 9 | |
| 10 # figure the instance home | |
| 11 import os | |
| 12 if len(sys.argv) > 1: | |
| 13 instance_home = sys.argv[1] | |
| 14 else: | |
| 15 instance_home = os.environ.get('ROUNDUP_INSTANCE', '') | |
| 16 if not instance_home: | |
| 17 print 'No instance home specified' | |
| 18 sys.exit(1) | |
| 19 | |
| 20 # get the instance | |
| 21 path, instance = os.path.split(instance_home) | |
| 22 sys.path.insert(0, path) | |
| 23 instance = __import__(instance) | |
| 24 sys.path[0] | |
| 25 | |
| 26 # invokde the mail handler | |
| 27 db = instance.open('admin') | |
| 28 handler = instance.MailGW(db) | |
| 29 handler.main(sys.stdin) | |
| 30 | |
| 31 # | |
| 32 # $Log: not supported by cvs2svn $ | |
| 33 # | |
| 34 |
