[Zodb-checkins] CVS: ZODB3/ZODB - BaseStorage.py:1.34.6.1 Connection.py:1.98.6.1 DB.py:1.53.4.1 DemoStorage.py:1.18.12.1 FileStorage.py:1.135.8.1 MappingStorage.py:1.9.26.1 Mount.py:1.19.22.1 __init__.py:1.23.6.1 coptimizations.c:1.23.36.1 fsdump.py:1.7.10.1 fsrecover.py:1.12.8.1 fstools.py:1.1.48.1 utils.py:1.17.6.1

Jeremy Hylton jeremy at zope.com
Tue Jul 1 16:34:42 EDT 2003


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv29339/ZODB

Modified Files:
      Tag: zodb33-devel-branch
	BaseStorage.py Connection.py DB.py DemoStorage.py 
	FileStorage.py MappingStorage.py Mount.py __init__.py 
	coptimizations.c fsdump.py fsrecover.py fstools.py utils.py 
Log Message:
Track module moves from ZODB to Persistence.

Add a few quick hacks to the BTrees code to get them to compile.


=== ZODB3/ZODB/BaseStorage.py 1.34 => 1.34.6.1 ===
--- ZODB3/ZODB/BaseStorage.py:1.34	Tue Jun 10 11:46:31 2003
+++ ZODB3/ZODB/BaseStorage.py	Tue Jul  1 15:34:10 2003
@@ -19,7 +19,7 @@
 import ThreadLock, bpthread
 import time, UndoLogCompatible
 import POSException
-from TimeStamp import TimeStamp
+from Persistence.TimeStamp import TimeStamp
 z64='\0'*8
 
 class BaseStorage(UndoLogCompatible.UndoLogCompatible):


=== ZODB3/ZODB/Connection.py 1.98 => 1.98.6.1 ===
--- ZODB3/ZODB/Connection.py:1.98	Fri Jun 13 17:53:08 2003
+++ ZODB3/ZODB/Connection.py	Tue Jul  1 15:34:10 2003
@@ -15,11 +15,8 @@
 
 $Id$"""
 
-from __future__ import nested_scopes
-
-from cPickleCache import PickleCache
+from Persistence.cPickleCache import PickleCache
 from POSException import ConflictError, ReadConflictError, TransactionError
-from ExtensionClass import Base
 import ExportImport, TmpStore
 from zLOG import LOG, ERROR, BLATHER, WARNING
 from coptimizations import new_persistent_id
@@ -45,8 +42,6 @@
     global global_code_timestamp
     global_code_timestamp = time()
 
-ExtensionKlass = Base.__class__
-
 class Connection(ExportImport.ExportImport):
     """Object managers for individual object space.
 
@@ -167,7 +162,7 @@
             object=klass.__basicnew__()
         else:
             object = klass(*args)
-            if klass is not ExtensionKlass:
+            if klass is not type:
                 object.__dict__.clear()
 
         object._p_oid=oid
@@ -356,7 +351,7 @@
         #
         #     klass=object.__class__
         #
-        #     if klass is ExtensionKlass: return oid
+        #     if klass is type: return oid
         #
         #     if hasattr(klass, '__getinitargs__'): return oid
         #
@@ -395,7 +390,7 @@
 
             klass = object.__class__
 
-            if klass is ExtensionKlass:
+            if klass is type:
                 # Yee Ha!
                 dict={}
                 dict.update(object.__dict__)
@@ -650,7 +645,7 @@
 
             klass, args = copy
 
-            if klass is not ExtensionKlass:
+            if klass is not type:
                 LOG('ZODB',ERROR,
                     "Unexpected klass when setting class state on %s"
                     % getattr(object,'__name__','(?)'))


=== ZODB3/ZODB/DB.py 1.53 => 1.53.4.1 ===
--- ZODB3/ZODB/DB.py:1.53	Tue Jun 24 17:50:18 2003
+++ ZODB3/ZODB/DB.py	Tue Jul  1 15:34:10 2003
@@ -84,8 +84,8 @@
             storage.load('\0\0\0\0\0\0\0\0','')
         except KeyError:
             # Create the database's root in the storage if it doesn't exist
-            import PersistentMapping
-            root = PersistentMapping.PersistentMapping()
+            from Persistence.PersistentMapping import PersistentMapping
+            root = PersistentMapping()
             # Manually create a pickle for the root to put in the storage.
             # The pickle must be in the special ZODB format.
             file = cStringIO.StringIO()


=== ZODB3/ZODB/DemoStorage.py 1.18 => 1.18.12.1 ===
--- ZODB3/ZODB/DemoStorage.py:1.18	Tue Apr 22 14:11:44 2003
+++ ZODB3/ZODB/DemoStorage.py	Tue Jul  1 15:34:10 2003
@@ -83,7 +83,7 @@
 
 import base64, time, string
 from ZODB import POSException, BaseStorage, utils
-from TimeStamp import TimeStamp
+from Persistence.TimeStamp import TimeStamp
 from cPickle import loads
 from BTrees import OOBTree
 


=== ZODB3/ZODB/FileStorage.py 1.135 => 1.135.8.1 ===
--- ZODB3/ZODB/FileStorage.py:1.135	Fri May 30 15:20:55 2003
+++ ZODB3/ZODB/FileStorage.py	Tue Jul  1 15:34:10 2003
@@ -130,9 +130,9 @@
 # Not all platforms have fsync
 fsync = getattr(os, "fsync", None)
 
+from Persistence.TimeStamp import TimeStamp
 from ZODB import BaseStorage, ConflictResolution, POSException
 from ZODB.POSException import UndoError, POSKeyError, MultipleUndoErrors
-from ZODB.TimeStamp import TimeStamp
 from ZODB.lock_file import LockFile
 from ZODB.utils import p64, u64, cp, z64
 from ZODB.fspack import FileStoragePacker


=== ZODB3/ZODB/MappingStorage.py 1.9 => 1.9.26.1 ===
--- ZODB3/ZODB/MappingStorage.py:1.9	Mon Jan 13 19:12:14 2003
+++ ZODB3/ZODB/MappingStorage.py	Tue Jul  1 15:34:10 2003
@@ -26,7 +26,7 @@
 from ZODB import utils
 from ZODB import BaseStorage
 from ZODB import POSException
-from ZODB.TimeStamp import TimeStamp
+from Persistence.TimeStamp import TimeStamp
 
 
 class MappingStorage(BaseStorage.BaseStorage):


=== ZODB3/ZODB/Mount.py 1.19 => 1.19.22.1 ===
--- ZODB3/ZODB/Mount.py:1.19	Thu Feb  6 15:31:17 2003
+++ ZODB3/ZODB/Mount.py	Tue Jul  1 15:34:10 2003
@@ -18,7 +18,7 @@
 
 import thread, Persistence, Acquisition
 from Acquisition import aq_base
-import ExtensionClass, string, time, sys
+import string, time, sys
 from POSException import MountedStorageError
 from zLOG import LOG, ERROR, INFO, WARNING
 


=== ZODB3/ZODB/__init__.py 1.23 => 1.23.6.1 ===
--- ZODB3/ZODB/__init__.py:1.23	Mon Jun 16 17:49:58 2003
+++ ZODB3/ZODB/__init__.py	Tue Jul  1 15:34:10 2003
@@ -12,35 +12,7 @@
 #
 ##############################################################################
 
-__version__ = '3.2b2'
-
-import sys
-import cPersistence, Persistence
-from zLOG import register_subsystem
-
-# This is lame. Don't look. :(
-sys.modules['cPersistence'] = cPersistence
-
-Persistent = cPersistence.Persistent
-
-# Install Persistent and PersistentMapping in Persistence
-if not hasattr(Persistence, 'Persistent'):
-    Persistence.Persistent = Persistent
-    Persistent.__module__ = 'Persistence'
-    Persistence.Overridable = cPersistence.Overridable
-    Persistence.Overridable.__module__ = 'Persistence'
-    if not hasattr(Persistence, 'PersistentMapping'):
-        import PersistentMapping
-        sys.modules['PersistentMapping'] = PersistentMapping
-        sys.modules['BoboPOS'] = sys.modules['ZODB']
-        sys.modules['BoboPOS.PersistentMapping'] = PersistentMapping
-        PersistentMapping = PersistentMapping.PersistentMapping
-        from PersistentMapping import PersistentMapping
-        Persistence.PersistentMapping = PersistentMapping
-        PersistentMapping.__module__ = 'Persistence'
-        del PersistentMapping
-
-del cPersistence
+__version__ = "3.3a0"
 
 from DB import DB
 


=== ZODB3/ZODB/coptimizations.c 1.23 => 1.23.36.1 ===
--- ZODB3/ZODB/coptimizations.c:1.23	Fri Dec 13 16:56:05 2002
+++ ZODB3/ZODB/coptimizations.c	Tue Jul  1 15:34:10 2003
@@ -17,7 +17,6 @@
 "$Id$\n";
 
 #include "Python.h"
-#define DONT_USE_CPERSISTENCECAPI
 #include "cPersistence.h"
 
 static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;}
@@ -74,19 +73,13 @@
 {
     PyObject *class = NULL;
 
-    if (!PyExtensionClass_Check(object)) {
-	if (PyExtensionInstance_Check(object)) {
+    if (!PyType_Check(object)) {
+	if (PER_TypeCheck(object)) {
 	    class = PyObject_GetAttr(object, py___class__);
 	    if (!class) {
 		PyErr_Clear();
 		return 0;
 	    }
-	    /* The __class__ must be an extension class. */
-	    if (!(((PyExtensionClass*)class)->class_flags 
-		  & PERSISTENT_TYPE_FLAG)) {
-		Py_DECREF(class);
-		return 0;
-	    }
 	}
 	else
 	    /* Most objects will exit via this path.  They are neither
@@ -217,8 +210,7 @@
 	    goto err;
     }
 
-    if (PyExtensionClass_Check(object)
-	|| PyObject_HasAttr(klass, py___getinitargs__))
+    if (PyType_Check(object) || PyObject_HasAttr(klass, py___getinitargs__))
 	goto return_oid;
 
     t2 = get_class_tuple(klass, oid);
@@ -316,13 +308,13 @@
     UNLESS (m) return;
     InvalidObjectReference=m;
 
-    if (!ExtensionClassImported) 
+    cPersistenceCAPI = PyCObject_Import("Persistence.cPersistence", "CAPI");
+    if (!cPersistenceCAPI)
 	return;
 
     m = Py_InitModule3("coptimizations", Module_Level__methods,
 		       coptimizations_doc_string);
-    d = PyModule_GetDict(m);
 
     persistent_idType.ob_type = &PyType_Type;
-    PyDict_SetItemString(d,"persistent_idType", OBJECT(&persistent_idType));
+    PyModule_AddObject(m, "persistent_idType", (PyObject *)&persistent_idType);
 }


=== ZODB3/ZODB/fsdump.py 1.7 => 1.7.10.1 ===
--- ZODB3/ZODB/fsdump.py:1.7	Fri May  2 10:50:39 2003
+++ ZODB3/ZODB/fsdump.py	Tue Jul  1 15:34:10 2003
@@ -1,7 +1,7 @@
 from ZODB.FileStorage import FileIterator
-from ZODB.TimeStamp import TimeStamp
 from ZODB.utils import u64
 from ZODB.tests.StorageTestBase import zodb_unpickle
+from Persistence.TimeStamp import TimeStamp
 
 from cPickle import Unpickler
 from cStringIO import StringIO


=== ZODB3/ZODB/fsrecover.py 1.12 => 1.12.8.1 ===
--- ZODB3/ZODB/fsrecover.py:1.12	Fri May 30 15:59:55 2003
+++ ZODB3/ZODB/fsrecover.py	Tue Jul  1 15:34:10 2003
@@ -83,7 +83,7 @@
 import getopt, ZODB.FileStorage, struct, time
 from struct import unpack
 from ZODB.utils import t32, p64, u64
-from ZODB.TimeStamp import TimeStamp
+from Persistence.TimeStamp import TimeStamp
 from cPickle import loads
 from ZODB.FileStorage import RecordIterator
 


=== ZODB3/ZODB/fstools.py 1.1 => 1.1.48.1 ===
--- ZODB3/ZODB/fstools.py:1.1	Mon Nov 18 15:45:48 2002
+++ ZODB3/ZODB/fstools.py	Tue Jul  1 15:34:10 2003
@@ -24,7 +24,7 @@
 from ZODB.FileStorage import TRANS_HDR, DATA_HDR, TRANS_HDR_LEN, \
      DATA_HDR_LEN, DATA_VERSION_HDR_LEN
 from ZODB.utils import p64, u64
-from ZODB.TimeStamp import TimeStamp
+from Persistence.TimeStamp import TimeStamp
 
 class TxnHeader:
     """Object representing a transaction record header.


=== ZODB3/ZODB/utils.py 1.17 => 1.17.6.1 ===
--- ZODB3/ZODB/utils.py:1.17	Tue Jun 10 11:46:31 2003
+++ ZODB3/ZODB/utils.py	Tue Jul  1 15:34:10 2003
@@ -13,7 +13,8 @@
 ##############################################################################
 
 import sys
-import TimeStamp, time
+import time
+from Persistence.TimeStamp import TimeStamp
 
 from struct import pack, unpack
 from types import StringType
@@ -80,7 +81,7 @@
 
 
 def newTimeStamp(old=None,
-                 TimeStamp=TimeStamp.TimeStamp,
+                 TimeStamp=TimeStamp,
                  time=time.time, gmtime=time.gmtime):
     t = time()
     ts = TimeStamp(gmtime(t)[:5]+(t%60,))




More information about the Zodb-checkins mailing list