Commit 3765adf4 authored by Jim Fulton's avatar Jim Fulton

refinement

parent 81501bca
......@@ -47,8 +47,8 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.1 1998/11/11 02:00:55 jim Exp $"""
__version__='$Revision: 1.1 $'[11:-2]
$Id: Connection.py,v 1.2 1999/04/28 11:10:48 jim Exp $"""
__version__='$Revision: 1.2 $'[11:-2]
from PickleCache import PickleCache
from bpthread import allocate_lock
......@@ -327,6 +327,19 @@ class Connection:
invalidate=self._db.invalidate
for oid in self._invalidating: invalidate(oid, self)
def exportFile(self, oid, file=None):
pass # Not implemented yet
def importFile(self, file):
pass # Not implemented yet
######################################################################
# BoboPOS 2 compat.
def export_file(self, o, file=None): return self.exportFile(o._p_oid, file)
import_file=importFile
class tConnection(Connection):
def close(self):
......
......@@ -47,8 +47,8 @@
##############################################################################
"""Database objects
$Id: DB.py,v 1.1 1998/11/11 02:00:55 jim Exp $"""
__version__='$Revision: 1.1 $'[11:-2]
$Id: DB.py,v 1.2 1999/04/28 11:10:48 jim Exp $"""
__version__='$Revision: 1.2 $'[11:-2]
import cPickle, cStringIO, sys
from Connection import Connection
......@@ -225,6 +225,8 @@ class DB:
self._connectionMap(f)
return m[0]
def close(self): self._storage.close()
def commitVersion(self, source, destination=''):
raise 'Not yet implemented'
......@@ -383,6 +385,16 @@ class DB:
self._version_cache_deactivate_after=v
def setVersionCacheSize(self, v): self._version_cache_size=v
def setVersionPoolSize(self, v): self._version_pool_size=v
def getCacheDeactivateAfter(self): return self._cache_deactivate_after
def getCacheSize(self): return self._cache_size
def getPoolSize(self): return self._pool_size
def getVersionCacheDeactivateAfter(self): return
self._version_cache_deactivate_after
def getVersionCacheSize(self): return self._version_cache_size
def getVersionPoolSize(self): return self._version_pool_size
def cacheStatistics(self): return () # :(
def versionEmpty(self, version):
return self._storage.versionEmpty(version)
......
......@@ -47,7 +47,7 @@
##############################################################################
"""File-based BoboPOS3 storage
"""
__version__='$Revision: 1.1 $'[11:-2]
__version__='$Revision: 1.2 $'[11:-2]
import struct, time, os, bpthread
now=time.time
......@@ -141,6 +141,10 @@ class FileStorage:
write(pack(">8siiHi4s", oid,pos,tloc,0,0,pc))
pos=unpack(">i",h[-4:])[0]
finally: self._r()
def close(self):
self._file.close()
# Eventuallly, we should save_index
def commitVersion(self, src, dest):
self._a()
......@@ -415,7 +419,7 @@ class FileStorage:
def tpc_abort(self, transaction):
self._a()
try:
if transaction != self._transaction: return
if transaction is not self._transaction: return
del self._tindex[:]
self._transaction=None
self._cr()
......@@ -436,7 +440,7 @@ class FileStorage:
def tpc_finish(self, transaction, f=None):
self._a()
try:
if transaction != self._transaction: return
if transaction is not self._transaction: return
if f is not None: f()
file=self._file
write=file.write
......@@ -496,6 +500,8 @@ class FileStorage:
seek(4,1)
return read(vlen) != version
finally: self._r()
packed_version='FS10'
......
......@@ -86,6 +86,9 @@ class BoboApplication:
v=conn.root()[aname]
if name is not None:
if hasattr(v, '__bobo_traverse__'):
return v.__bobo_traverse__(REQUEST, name)
if hasattr(v,name): return getattr(v,name)
return v[name]
......
Need Globals to have a DB attribute, which is the ZODB DB.
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