|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: instance.py,v 1.21 2004-09-26 13:16:40 a1s Exp $ |
| 18 | +# $Id: instance.py,v 1.22 2004-09-29 07:01:44 a1s Exp $ |
19 | 19 |
|
20 | 20 | '''Tracker handling (open tracker). |
21 | 21 |
|
|
24 | 24 | __docformat__ = 'restructuredtext' |
25 | 25 |
|
26 | 26 | import os |
27 | | -from roundup import configuration, rlog |
| 27 | +import types |
| 28 | +from roundup import configuration, mailgw, rlog |
28 | 29 | from roundup import hyperdb, backends |
| 30 | +from roundup.cgi import client |
29 | 31 |
|
30 | 32 | class Vars: |
31 | 33 | def __init__(self, vars): |
@@ -64,13 +66,21 @@ def open(self, name): |
64 | 66 | self._load_python('schema.py', vars) |
65 | 67 | db = vars['db'] |
66 | 68 |
|
| 69 | + self.load_interfaces() |
67 | 70 | self.load_extensions(db, 'detectors') |
68 | | - |
69 | 71 | self.load_extensions(self, 'extensions') |
70 | 72 |
|
71 | 73 | db.post_init() |
72 | 74 | return db |
73 | 75 |
|
| 76 | + def load_interfaces(self): |
| 77 | + """load interfaces.py (if any), initialize Client and MailGW attrs""" |
| 78 | + vars = {} |
| 79 | + if os.path.isfile(os.path.join(self.tracker_home, 'interfaces.py')): |
| 80 | + self._load_python('interfaces.py', vars) |
| 81 | + self.Client = vars.get('Client', client.Client) |
| 82 | + self.MailGW = vars.get('MailGW', mailgw.MailGW) |
| 83 | + |
74 | 84 | def load_extensions(self, parent, dirname): |
75 | 85 | dirpath = os.path.join(self.tracker_home, dirname) |
76 | 86 | if os.path.isdir(dirpath): |
|
0 commit comments