index 06e321ebdb4075e3840df5183357c6b1febb2ffa..4562d29900f113a21bd5b03dd7f3dab511da570d 100644 (file)
-#$Id: back_bsddb.py,v 1.6 2001-07-30 02:36:23 richard Exp $
+#
+# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
+# This module is free software, and you may redistribute it and/or modify
+# under the same terms as Python, so long as this copyright message and
+# disclaimer are retained in their original form.
+#
+# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
+# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
+# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
+# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+#
+#$Id: back_bsddb.py,v 1.9 2001-08-12 06:32:36 richard Exp $
import bsddb, os, marshal
from roundup import hyperdb, date
# convert the instance data to builtin types
properties = self.classes[classname].properties
for key in properties.keys():
- if properties[key].isDateType:
+ if isinstance(properties[key], hyperdb.Date):
node[key] = node[key].get_tuple()
- elif properties[key].isIntervalType:
+ elif isinstance(properties[key], hyperdb.Interval):
node[key] = node[key].get_tuple()
# now save the marshalled data
# convert the marshalled data to instances
properties = self.classes[classname].properties
for key in properties.keys():
- if properties[key].isDateType:
+ if isinstance(properties[key], hyperdb.Date):
res[key] = date.Date(res[key])
- elif properties[key].isIntervalType:
+ elif isinstance(properties[key], hyperdb.Interval):
res[key] = date.Interval(res[key])
if not cldb: db.close()
#
#$Log: not supported by cvs2svn $
+#Revision 1.8 2001/08/07 00:24:42 richard
+#stupid typo
+#
+#Revision 1.7 2001/08/07 00:15:51 richard
+#Added the copyright/license notice to (nearly) all files at request of
+#Bizar Software.
+#
+#Revision 1.6 2001/07/30 02:36:23 richard
+#Handle non-existence of db files in the other backends (code from anydbm).
+#
#Revision 1.5 2001/07/30 01:41:36 richard
#Makes schema changes mucho easier.
#