comparison roundup/hyperdb.py @ 4483:22bc0426e348

Second patch from issue2550688 -- with some changes: - password.py now has a second class JournalPassword used for journal storage. We have some backends that directly store serialized python objects. Also when reading from the journal some backends expected the string read to be usable as a parameter to a Password constructor. This now calls a JournalPassword constructor in all these cases. The new JournalPassword just keeps the scheme and has an empty password. - some factoring, move redundant implementation of "history" from rdbms_common and back_anydbm to hyperdb.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Thu, 14 Apr 2011 15:42:41 +0000
parents 9bbf3758c16a
children 4960a2c21590
comparison
equal deleted inserted replaced
4482:cb479067e970 4483:22bc0426e348
949 (date, tag, action, params) 949 (date, tag, action, params)
950 950
951 'date' is a Timestamp object specifying the time of the change and 951 'date' is a Timestamp object specifying the time of the change and
952 'tag' is the journaltag specified when the database was opened. 952 'tag' is the journaltag specified when the database was opened.
953 """ 953 """
954 raise NotImplementedError 954 if not self.do_journal:
955 raise ValueError('Journalling is disabled for this class')
956 return self.db.getjournal(self.classname, nodeid)
955 957
956 # Locating nodes: 958 # Locating nodes:
957 def hasnode(self, nodeid): 959 def hasnode(self, nodeid):
958 """Determine if the given nodeid actually exists 960 """Determine if the given nodeid actually exists
959 """ 961 """
1307 elif isinstance(prop, Date): 1309 elif isinstance(prop, Date):
1308 value = date.Date(value) 1310 value = date.Date(value)
1309 elif isinstance(prop, Interval): 1311 elif isinstance(prop, Interval):
1310 value = date.Interval(value) 1312 value = date.Interval(value)
1311 elif isinstance(prop, Password): 1313 elif isinstance(prop, Password):
1312 value = password.Password(encrypted=value) 1314 value = password.JournalPassword(encrypted=value)
1313 params[propname] = value 1315 params[propname] = value
1314 elif action == 'create' and params: 1316 elif action == 'create' and params:
1315 # old tracker with data stored in the create! 1317 # old tracker with data stored in the create!
1316 params = {} 1318 params = {}
1317 r.append((nodeid, date.Date(jdate), user, action, params)) 1319 r.append((nodeid, date.Date(jdate), user, action, params))

Roundup Issue Tracker: http://roundup-tracker.org/