Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.py @ 4430:f2f2904fe6ce
- refactor: move import_journal to hyperdb
.-- it was reimplemented in back_anydbm and rdbms_common and was
already inconsistent -- and it doen't have any backend dependencies
itself. Interestingly this now fails a test for memorydb (but
passes for anydbm: Huh?)
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 07 Oct 2010 12:22:10 +0000 |
| parents | 67bef70ab9b9 |
| children | 9d37875416c3 |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Thu Oct 07 12:02:12 2010 +0000 +++ b/roundup/backends/back_anydbm.py Thu Oct 07 12:22:10 2010 +0000 @@ -2000,34 +2000,6 @@ repr(action), repr(params)]) return r - def import_journals(self, entries): - """Import a class's journal. - - Uses setjournal() to set the journal for each item.""" - properties = self.getprops() - d = {} - for l in entries: - nodeid, jdate, user, action, params = tuple(map(eval, l)) - r = d.setdefault(nodeid, []) - if action == 'set': - for propname, value in params.iteritems(): - prop = properties[propname] - if value is None: - pass - elif isinstance(prop, hyperdb.Date): - value = date.Date(value) - elif isinstance(prop, hyperdb.Interval): - value = date.Interval(value) - elif isinstance(prop, hyperdb.Password): - pwd = password.Password() - pwd.unpack(value) - value = pwd - params[propname] = value - r.append((nodeid, date.Date(jdate), user, action, params)) - - for nodeid, l in d.iteritems(): - self.db.setjournal(self.classname, nodeid, l) - class FileClass(hyperdb.FileClass, Class): """This class defines a large chunk of data. To support this, it has a mandatory String property "content" which is typically saved off
