Mercurial > p > roundup > code
comparison roundup/scripts/roundup_mailgw.py @ 2633:a9e1fff1e793
I thought I committed this last night. Ho hum.
- This implements most of the rest of the new tracker config layout:
- dbinit.py split between schema.py and initial_data.py
- interfaces.py gone
- tracker and detectors __init__.py gone
- Added some missing functionality to backends: db_exists test and db_nuke.
- Implemented configuration file options in postgresql backend.
- Cleaned up tracker initialisation a lot.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 27 Jul 2004 00:57:19 +0000 |
| parents | c26bb78d2f0c |
| children | 437775793d8e |
comparison
equal
deleted
inserted
replaced
| 2632:9c55f2bc5961 | 2633:a9e1fff1e793 |
|---|---|
| 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.18 2004-05-28 00:56:50 richard Exp $ | 17 # $Id: roundup_mailgw.py,v 1.19 2004-07-27 00:57:18 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 |
| 24 from roundup import version_check | 24 from roundup import version_check |
| 25 from roundup import __version__ as roundup_version | 25 from roundup import __version__ as roundup_version |
| 26 | 26 |
| 27 import sys, os, re, cStringIO, getopt | 27 import sys, os, re, cStringIO, getopt |
| 28 | 28 |
| 29 from roundup.mailgw import Message | 29 from roundup import mailgw |
| 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 |
| 130 # get a mail handler | 130 # get a mail handler |
| 131 db = instance.open('admin') | 131 db = instance.open('admin') |
| 132 | 132 |
| 133 # now wrap in try/finally so we always close the database | 133 # now wrap in try/finally so we always close the database |
| 134 try: | 134 try: |
| 135 handler = instance.MailGW(instance, db, optionsList) | 135 if hasattr(instance, 'MailGW'): |
| 136 handler = instance.MailGW(instance, db, optionsList) | |
| 137 else: | |
| 138 handler = mailgw.MailGW(instance, db, optionsList) | |
| 136 | 139 |
| 137 # if there's no more arguments, read a single message from stdin | 140 # if there's no more arguments, read a single message from stdin |
| 138 if len(args) == 1: | 141 if len(args) == 1: |
| 139 return handler.do_pipe() | 142 return handler.do_pipe() |
| 140 | 143 |
