Commit 852219f8 authored by Shane Hathaway's avatar Shane Hathaway

Minor tidying: Fixed comments, updated BaseStorage documentation,

replaced `x` with repr(x), and replaced apply(x, y) with x(*y)
parent 9ce4c7fe
...@@ -34,6 +34,7 @@ class BaseStorage(UndoLogCompatible): ...@@ -34,6 +34,7 @@ class BaseStorage(UndoLogCompatible):
A subclass must define the following methods: A subclass must define the following methods:
load() load()
store()
close() close()
cleanup() cleanup()
lastSerial() lastSerial()
...@@ -53,7 +54,6 @@ class BaseStorage(UndoLogCompatible): ...@@ -53,7 +54,6 @@ class BaseStorage(UndoLogCompatible):
If the subclass wants to implement undo, it should implement the If the subclass wants to implement undo, it should implement the
multiple revision methods and: multiple revision methods and:
loadSerial()
undo() undo()
undoInfo() undoInfo()
undoLog() undoLog()
...@@ -94,9 +94,9 @@ class BaseStorage(UndoLogCompatible): ...@@ -94,9 +94,9 @@ class BaseStorage(UndoLogCompatible):
self._commit_lock_acquire = l.acquire self._commit_lock_acquire = l.acquire
self._commit_lock_release = l.release self._commit_lock_release = l.release
t=time.time() t = time.time()
t=self._ts=apply(TimeStamp,(time.gmtime(t)[:5]+(t%60,))) t = self._ts = TimeStamp(*(time.gmtime(t)[:5] + (t%60,)))
self._tid = `t` self._tid = repr(t)
# ._oid is the highest oid in use (0 is always in use -- it's # ._oid is the highest oid in use (0 is always in use -- it's
# a reserved oid for the root object). Our new_oid() method # a reserved oid for the root object). Our new_oid() method
...@@ -228,7 +228,7 @@ class BaseStorage(UndoLogCompatible): ...@@ -228,7 +228,7 @@ class BaseStorage(UndoLogCompatible):
now = time.time() now = time.time()
t = TimeStamp(*(time.gmtime(now)[:5] + (now % 60,))) t = TimeStamp(*(time.gmtime(now)[:5] + (now % 60,)))
self._ts = t = t.laterThan(self._ts) self._ts = t = t.laterThan(self._ts)
self._tid = `t` self._tid = repr(t)
else: else:
self._ts = TimeStamp(tid) self._ts = TimeStamp(tid)
self._tid = tid self._tid = tid
......
...@@ -21,7 +21,7 @@ The Demo storage serves two purposes: ...@@ -21,7 +21,7 @@ The Demo storage serves two purposes:
- Provide a volatile storage that is useful for giving demonstrations. - Provide a volatile storage that is useful for giving demonstrations.
The demo storage can have a "base" storage that is used in a The demo storage can have a "base" storage that is used in a
read-only fashion. The base storage must not not to contain version read-only fashion. The base storage must not contain version
data. data.
There are three main data structures: There are three main data structures:
......
...@@ -993,7 +993,11 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -993,7 +993,11 @@ class FileStorage(BaseStorage.BaseStorage,
return "", None return "", None
def _transactionalUndoRecord(self, oid, pos, tid, pre, version): def _transactionalUndoRecord(self, oid, pos, tid, pre, version):
"""Get the indo information for a data record """Get the undo information for a data record
'pos' points to the data header for 'oid' in the transaction
being undone. 'tid' refers to the transaction being undone.
'pre' is the 'prev' field of the same data header.
Return a 5-tuple consisting of a pickle, data pointer, Return a 5-tuple consisting of a pickle, data pointer,
version, packed non-version data pointer, and current version, packed non-version data pointer, and current
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment