comparison roundup/templates/extended/dbinit.py @ 524:dce4c75bef5a

changed all config accesses... ...so they access either the instance or the config attriubute on the db. This means that all config is obtained from instance_config instead of the mish-mash of classes. This will make switching to a ConfigParser setup easier too, I hope. At a minimum, this makes migration a _little_ easier (a lot easier in the 0.5.0 switch, I hope!)
author Richard Jones <richard@users.sourceforge.net>
date Mon, 14 Jan 2002 02:20:15 +0000
parents a1a44636bace
children edd210915e64
comparison
equal deleted inserted replaced
523:32db08940334 524:dce4c75bef5a
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: dbinit.py,v 1.18 2002-01-02 02:31:38 richard Exp $ 18 # $Id: dbinit.py,v 1.19 2002-01-14 02:20:15 richard Exp $
19 19
20 import os 20 import os
21 21
22 import instance_config 22 import instance_config
23 from roundup import roundupdb 23 from roundup import roundupdb
33 pass 33 pass
34 34
35 class IssueClass(roundupdb.IssueClass): 35 class IssueClass(roundupdb.IssueClass):
36 ''' issues need the email information 36 ''' issues need the email information
37 ''' 37 '''
38 INSTANCE_NAME = instance_config.INSTANCE_NAME 38 pass
39 ISSUE_TRACKER_WEB = instance_config.ISSUE_TRACKER_WEB
40 ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL
41 ADMIN_EMAIL = instance_config.ADMIN_EMAIL
42 MAILHOST = instance_config.MAILHOST
43 MESSAGES_TO_AUTHOR = instance_config.MESSAGES_TO_AUTHOR
44 EMAIL_SIGNATURE_POSITION = instance_config.EMAIL_SIGNATURE_POSITION
45 39
46 40
47 def open(name=None): 41 def open(name=None):
48 ''' as from the roundupdb method openDB 42 ''' as from the roundupdb method openDB
49 43
50 ''' 44 '''
51 from roundup.hyperdb import String, Password, Date, Link, Multilink 45 from roundup.hyperdb import String, Password, Date, Link, Multilink
52 46
53 # open the database 47 # open the database
54 db = Database(instance_config.DATABASE, name) 48 db = Database(instance_config, name)
55 49
56 # Now initialise the schema. Must do this each time. 50 # Now initialise the schema. Must do this each time.
57 pri = Class(db, "priority", 51 pri = Class(db, "priority",
58 name=String(), order=String()) 52 name=String(), order=String())
59 pri.setkey("name") 53 pri.setkey("name")
177 171
178 db.commit() 172 db.commit()
179 173
180 # 174 #
181 # $Log: not supported by cvs2svn $ 175 # $Log: not supported by cvs2svn $
176 # Revision 1.18 2002/01/02 02:31:38 richard
177 # Sorry for the huge checkin message - I was only intending to implement #496356
178 # but I found a number of places where things had been broken by transactions:
179 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
180 # for _all_ roundup-generated smtp messages to be sent to.
181 # . the transaction cache had broken the roundupdb.Class set() reactors
182 # . newly-created author users in the mailgw weren't being committed to the db
183 #
184 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
185 # on when I found that stuff :):
186 # . #496356 ] Use threading in messages
187 # . detectors were being registered multiple times
188 # . added tests for mailgw
189 # . much better attaching of erroneous messages in the mail gateway
190 #
182 # Revision 1.17 2001/12/02 05:06:16 richard 191 # Revision 1.17 2001/12/02 05:06:16 richard
183 # . We now use weakrefs in the Classes to keep the database reference, so 192 # . We now use weakrefs in the Classes to keep the database reference, so
184 # the close() method on the database is no longer needed. 193 # the close() method on the database is no longer needed.
185 # I bumped the minimum python requirement up to 2.1 accordingly. 194 # I bumped the minimum python requirement up to 2.1 accordingly.
186 # . #487480 ] roundup-server 195 # . #487480 ] roundup-server

Roundup Issue Tracker: http://roundup-tracker.org/