Skip to content

Commit f63de32

Browse files
author
Alexander Smishlajev
committed
load user interfaces
1 parent cf3a1ba commit f63de32

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

roundup/instance.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
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 $
1919

2020
'''Tracker handling (open tracker).
2121
@@ -24,8 +24,10 @@
2424
__docformat__ = 'restructuredtext'
2525

2626
import os
27-
from roundup import configuration, rlog
27+
import types
28+
from roundup import configuration, mailgw, rlog
2829
from roundup import hyperdb, backends
30+
from roundup.cgi import client
2931

3032
class Vars:
3133
def __init__(self, vars):
@@ -64,13 +66,21 @@ def open(self, name):
6466
self._load_python('schema.py', vars)
6567
db = vars['db']
6668

69+
self.load_interfaces()
6770
self.load_extensions(db, 'detectors')
68-
6971
self.load_extensions(self, 'extensions')
7072

7173
db.post_init()
7274
return db
7375

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+
7484
def load_extensions(self, parent, dirname):
7585
dirpath = os.path.join(self.tracker_home, dirname)
7686
if os.path.isdir(dirpath):

0 commit comments

Comments
 (0)