Commit 4171baa3 authored by Guido van Rossum's avatar Guido van Rossum

Use fsIndex() for the index, if it exists. This completes the merge

of the StandaloneZODB-1_0-branch into the trunk.  The
StandaloneZODB-1_0-branch is now dead!
parent 9c54f093
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.81 $'[11:-2] __version__='$Revision: 1.82 $'[11:-2]
import struct, time, os, string, base64, sys import struct, time, os, string, base64, sys
from struct import pack, unpack from struct import pack, unpack
...@@ -130,6 +130,12 @@ import BaseStorage ...@@ -130,6 +130,12 @@ import BaseStorage
from cPickle import Pickler, Unpickler, loads from cPickle import Pickler, Unpickler, loads
import ConflictResolution import ConflictResolution
try:
from fsIndex import fsIndex
except ImportError:
def fsIndex():
return {}
try: from posix import fsync try: from posix import fsync
except: fsync=None except: fsync=None
...@@ -1327,7 +1333,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1327,7 +1333,7 @@ class FileStorage(BaseStorage.BaseStorage,
rootl=[z64] rootl=[z64]
pop=rootl.pop pop=rootl.pop
pindex={} pindex=fsIndex()
referenced=pindex.has_key referenced=pindex.has_key
_load=self._load _load=self._load
_loada=self._loada _loada=self._loada
...@@ -1357,7 +1363,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1357,7 +1363,7 @@ class FileStorage(BaseStorage.BaseStorage,
# Index for non-version data. This is a temporary structure # Index for non-version data. This is a temporary structure
# to reduce I/O during packing # to reduce I/O during packing
nvindex={} nvindex=fsIndex()
# Cache a bunch of methods # Cache a bunch of methods
seek=file.seek seek=file.seek
......
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