Mercurial > p > roundup > code
changeset 2963:d29673626906 maint-0.7
fix some introduced import bugs
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 25 Nov 2004 22:56:14 +0000 |
| parents | 409510fcb18f |
| children | 0e1860dcb328 |
| files | roundup/backends/back_anydbm.py roundup/backends/blobfiles.py roundup/hyperdb.py |
| diffstat | 3 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Thu Nov 25 22:26:36 2004 +0000 +++ b/roundup/backends/back_anydbm.py Thu Nov 25 22:56:14 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.146.2.21 2004-11-23 23:56:08 richard Exp $ +#$Id: back_anydbm.py,v 1.146.2.22 2004-11-25 22:56:14 richard Exp $ '''This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several @@ -41,7 +41,6 @@ from roundup.backends import locking from roundup.hyperdb import String, Password, Date, Interval, Link, \ Multilink, DatabaseError, Boolean, Number, Node -from roundup.date import Range, Date # # Now the database @@ -385,10 +384,12 @@ properties = self.getclass(classname).getprops() d = {} for k, v in node.items(): - # if the property doesn't exist, or is the "retired" flag then - # it won't be in the properties dict + if k == self.RETIRED_FLAG: + d[k] = v + continue + + # if the property doesn't exist then we really don't care if not properties.has_key(k): - d[k] = v continue # get the property spec @@ -2081,7 +2082,7 @@ elif isinstance(prop, Date): if type(value) == type(()): print 'warning: invalid date tuple %r'%(value,) - value = Date( "2000-1-1" ) + value = date.Date("2000-1-1") value = date.Date(value) elif isinstance(prop, Interval): value = date.Interval(value)
--- a/roundup/backends/blobfiles.py Thu Nov 25 22:26:36 2004 +0000 +++ b/roundup/backends/blobfiles.py Thu Nov 25 22:56:14 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: blobfiles.py,v 1.12.2.4 2004-11-22 02:38:24 richard Exp $ +#$Id: blobfiles.py,v 1.12.2.5 2004-11-25 22:56:14 richard Exp $ '''This module exports file storage for roundup backends. Files are stored into a directory hierarchy. ''' @@ -37,7 +37,7 @@ class FileStorage: """Store files in some directory structure""" - def filename(self, classname, nodeid, property=None, create=False): + def filename(self, classname, nodeid, property=None, create=0): '''Determine what the filename for the given node and optionally property is. @@ -82,7 +82,7 @@ is being saved. ''' # determine the name of the file to write to - name = self.filename(classname, nodeid, property, create=True) + name = self.filename(classname, nodeid, property, create=1) # make sure the file storage dir exists if not os.path.exists(os.path.dirname(name)):
--- a/roundup/hyperdb.py Thu Nov 25 22:26:36 2004 +0000 +++ b/roundup/hyperdb.py Thu Nov 25 22:56:14 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.97.2.5 2004-10-08 00:57:22 richard Exp $ +# $Id: hyperdb.py,v 1.97.2.6 2004-11-25 22:56:14 richard Exp $ """Hyperdatabase implementation, especially field types. """ @@ -787,7 +787,7 @@ def import_files(self, dirname, nodeid): ''' Import the "content" property as a file ''' - dest = self.db.filename(self.classname, nodeid) + dest = self.db.filename(self.classname, nodeid, create=1) x, filename = os.path.split(dest) x, subdir = os.path.split(x) source = os.path.join(dirname, self.classname+'-files', subdir,
