Skip to content

Commit ded4b0b

Browse files
author
Alexander Smishlajev
committed
use new style config;
drop logging configuration logging as the config does this itself; fix vim modeline.
1 parent d16dc17 commit ded4b0b

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

roundup/instance.py

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17-
#
18-
# $Id: instance.py,v 1.15 2004-07-19 01:49:26 richard Exp $
17+
#
18+
# $Id: instance.py,v 1.16 2004-07-25 13:14:57 a1s Exp $
1919

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

2626
import os
27-
from roundup import rlog
27+
from roundup import configuration, rlog
2828

2929
class Vars:
3030
''' I'm just a container '''
@@ -87,28 +87,16 @@ def open(self, tracker_home):
8787
tracker = imp.load_package(modname, tracker_home)
8888

8989
# ensure the tracker has all the required bits
90-
for required in 'config open init Client MailGW'.split():
90+
for required in 'open init Client MailGW'.split():
9191
if not hasattr(tracker, required):
9292
raise TrackerError, \
9393
'Required tracker attribute "%s" missing'%required
9494

95-
# init the logging
96-
config = tracker.config
97-
if hasattr(config, 'LOGGING_CONFIG'):
98-
try:
99-
import logging
100-
config.logging = logging
101-
except ImportError, msg:
102-
raise TrackerError, 'Python logging module unavailable: %s'%msg
103-
config.logging.fileConfig(config.LOGGING_CONFIG)
104-
else:
105-
config.logging = rlog.BasicLogging()
106-
if hasattr(config, 'LOGGING_FILENAME'):
107-
config.logging.setFile(config.LOGGING_FILENAME)
108-
if hasattr(config, 'LOGGING_LEVEL'):
109-
config.logging.setLevel(config.LOGGING_LEVEL)
110-
else:
111-
config.logging.setLevel('ERROR')
95+
# load and apply the config
96+
tracker.config = configuration.Config(tracker_home)
97+
# FIXME! dbinit does "import config".
98+
# What would be the upgrade plan for existing trackers?
99+
tracker.dbinit.config = tracker.config
112100

113101
return tracker
114102

@@ -120,4 +108,4 @@ def open(tracker_home):
120108

121109
return Tracker(tracker_home)
122110

123-
# vim: set filetype=python ts=4 sw=4 et si
111+
# vim: set filetype=python sts=4 sw=4 et si :

0 commit comments

Comments
 (0)