Mercurial > p > roundup > code
comparison roundup/templates/classic/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.13 2002-01-02 02:31:38 richard Exp $ | 18 # $Id: dbinit.py,v 1.14 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") |
| 126 address=instance_config.ADMIN_EMAIL) | 120 address=instance_config.ADMIN_EMAIL) |
| 127 db.commit() | 121 db.commit() |
| 128 | 122 |
| 129 # | 123 # |
| 130 # $Log: not supported by cvs2svn $ | 124 # $Log: not supported by cvs2svn $ |
| 125 # Revision 1.13 2002/01/02 02:31:38 richard | |
| 126 # Sorry for the huge checkin message - I was only intending to implement #496356 | |
| 127 # but I found a number of places where things had been broken by transactions: | |
| 128 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename | |
| 129 # for _all_ roundup-generated smtp messages to be sent to. | |
| 130 # . the transaction cache had broken the roundupdb.Class set() reactors | |
| 131 # . newly-created author users in the mailgw weren't being committed to the db | |
| 132 # | |
| 133 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working | |
| 134 # on when I found that stuff :): | |
| 135 # . #496356 ] Use threading in messages | |
| 136 # . detectors were being registered multiple times | |
| 137 # . added tests for mailgw | |
| 138 # . much better attaching of erroneous messages in the mail gateway | |
| 139 # | |
| 131 # Revision 1.12 2001/12/02 05:06:16 richard | 140 # Revision 1.12 2001/12/02 05:06:16 richard |
| 132 # . We now use weakrefs in the Classes to keep the database reference, so | 141 # . We now use weakrefs in the Classes to keep the database reference, so |
| 133 # the close() method on the database is no longer needed. | 142 # the close() method on the database is no longer needed. |
| 134 # I bumped the minimum python requirement up to 2.1 accordingly. | 143 # I bumped the minimum python requirement up to 2.1 accordingly. |
| 135 # . #487480 ] roundup-server | 144 # . #487480 ] roundup-server |
