Mercurial > p > roundup > code
comparison roundup/hyperdb.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 | 59e87f7b7916 |
| children | 53839883cab6 |
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: hyperdb.py,v 1.46 2002-01-07 10:42:23 richard Exp $ | 18 # $Id: hyperdb.py,v 1.47 2002-01-14 02:20:15 richard Exp $ |
| 19 | 19 |
| 20 __doc__ = """ | 20 __doc__ = """ |
| 21 Hyperdatabase implementation, especially field types. | 21 Hyperdatabase implementation, especially field types. |
| 22 """ | 22 """ |
| 23 | 23 |
| 96 ''' | 96 ''' |
| 97 | 97 |
| 98 # flag to set on retired entries | 98 # flag to set on retired entries |
| 99 RETIRED_FLAG = '__hyperdb_retired' | 99 RETIRED_FLAG = '__hyperdb_retired' |
| 100 | 100 |
| 101 def __init__(self, storagelocator, journaltag=None): | 101 # XXX deviates from spec: storagelocator is obtained from the config |
| 102 def __init__(self, config, journaltag=None): | |
| 102 """Open a hyperdatabase given a specifier to some storage. | 103 """Open a hyperdatabase given a specifier to some storage. |
| 103 | 104 |
| 105 The 'storagelocator' is obtained from config.DATABASE. | |
| 104 The meaning of 'storagelocator' depends on the particular | 106 The meaning of 'storagelocator' depends on the particular |
| 105 implementation of the hyperdatabase. It could be a file name, | 107 implementation of the hyperdatabase. It could be a file name, |
| 106 a directory path, a socket descriptor for a connection to a | 108 a directory path, a socket descriptor for a connection to a |
| 107 database over the network, etc. | 109 database over the network, etc. |
| 108 | 110 |
| 1025 cl.create(name=option[i], order=i) | 1027 cl.create(name=option[i], order=i) |
| 1026 return hyperdb.Link(name) | 1028 return hyperdb.Link(name) |
| 1027 | 1029 |
| 1028 # | 1030 # |
| 1029 # $Log: not supported by cvs2svn $ | 1031 # $Log: not supported by cvs2svn $ |
| 1032 # Revision 1.46 2002/01/07 10:42:23 richard | |
| 1033 # oops | |
| 1034 # | |
| 1030 # Revision 1.45 2002/01/02 04:18:17 richard | 1035 # Revision 1.45 2002/01/02 04:18:17 richard |
| 1031 # hyperdb docstrings | 1036 # hyperdb docstrings |
| 1032 # | 1037 # |
| 1033 # Revision 1.44 2002/01/02 02:31:38 richard | 1038 # Revision 1.44 2002/01/02 02:31:38 richard |
| 1034 # Sorry for the huge checkin message - I was only intending to implement #496356 | 1039 # Sorry for the huge checkin message - I was only intending to implement #496356 |
