Commit 070fe804 authored by 's avatar

Merged Broken fixes from 22 branch

parent dfd7dbf3
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.38 2000/05/30 17:27:43 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.39 2000/06/23 17:10:45 brian Exp $";
#include <string.h> #include <string.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name) ...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
UNLESS(s=PyString_AsString(name)) return NULL; UNLESS(s=PyString_AsString(name)) return NULL;
r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro); r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro);
if (! r && if (! r && self->state != cPersistent_GHOST_STATE &&
(((PyExtensionClass*)(self->ob_type))->class_flags (((PyExtensionClass*)(self->ob_type))->class_flags
& EXTENSIONCLASS_USERGETATTR_FLAG) & EXTENSIONCLASS_USERGETATTR_FLAG)
) )
...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = { ...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = {
PERSISTENCE_FLAGS, PERSISTENCE_FLAGS,
}; };
static PyExtensionClass Overridable = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"Persistent", /*tp_name*/
sizeof(cPersistentObject), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
(destructor)Per_dealloc, /*tp_dealloc*/
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
(cmpfunc)0, /*tp_compare*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
(hashfunc)0, /*tp_hash*/
(ternaryfunc)0, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)Per_getattro, /*tp_getattr with object key*/
(setattrofunc)Per_setattro, /*tp_setattr with object key*/
/* Space for future expansion */
0L,0L,"",
METHOD_CHAIN(Per_methods),
EXTENSIONCLASS_BASICNEW_FLAG | PERSISTENT_TYPE_FLAG
};
/* End of code for Persistent objects */ /* End of code for Persistent objects */
/* -------------------------------------------------------- */ /* -------------------------------------------------------- */
...@@ -785,7 +812,7 @@ void ...@@ -785,7 +812,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.38 $"; char *rev="$Revision: 1.39 $";
TimeStamp=PyString_FromString("TimeStamp"); TimeStamp=PyString_FromString("TimeStamp");
if (! TimeStamp) return; if (! TimeStamp) return;
...@@ -803,7 +830,8 @@ initcPersistence() ...@@ -803,7 +830,8 @@ initcPersistence()
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
PyDict_SetItemString(d,"__version__", PyDict_SetItemString(d,"__version__",
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
PyExtensionClass_Export(d,"Persistent",Pertype); PyExtensionClass_Export(d, "Persistent", Pertype);
PyExtensionClass_Export(d, "Overridable", Overridable);
cPersistenceCAPI=&truecPersistenceCAPI; cPersistenceCAPI=&truecPersistenceCAPI;
PyDict_SetItemString(d, "CAPI", PyDict_SetItemString(d, "CAPI",
......
...@@ -91,12 +91,13 @@ register_subsystem('ZODB') ...@@ -91,12 +91,13 @@ register_subsystem('ZODB')
sys.modules['cPersistence']=cPersistence sys.modules['cPersistence']=cPersistence
Persistent=cPersistence.Persistent Persistent=cPersistence.Persistent
del cPersistence
# Install Persistent and PersistentMapping in Persistence # Install Persistent and PersistentMapping in Persistence
if not hasattr(Persistence, 'Persistent'): if not hasattr(Persistence, 'Persistent'):
Persistence.Persistent=Persistent Persistence.Persistent=Persistent
Persistent.__module__='Persistence' Persistent.__module__='Persistence'
Persistence.Overridable=cPersistence.Overridable
Persistence.Overridable.__module__='Persistence'
if not hasattr(Persistence, 'PersistentMapping'): if not hasattr(Persistence, 'PersistentMapping'):
import PersistentMapping import PersistentMapping
sys.modules['PersistentMapping']=PersistentMapping sys.modules['PersistentMapping']=PersistentMapping
...@@ -108,6 +109,8 @@ if not hasattr(Persistence, 'Persistent'): ...@@ -108,6 +109,8 @@ if not hasattr(Persistence, 'Persistent'):
PersistentMapping.__module__='Persistence' PersistentMapping.__module__='Persistence'
del PersistentMapping del PersistentMapping
del cPersistence
from DB import DB from DB import DB
import Transaction import Transaction
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.38 2000/05/30 17:27:43 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.39 2000/06/23 17:10:45 brian Exp $";
#include <string.h> #include <string.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name) ...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
UNLESS(s=PyString_AsString(name)) return NULL; UNLESS(s=PyString_AsString(name)) return NULL;
r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro); r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro);
if (! r && if (! r && self->state != cPersistent_GHOST_STATE &&
(((PyExtensionClass*)(self->ob_type))->class_flags (((PyExtensionClass*)(self->ob_type))->class_flags
& EXTENSIONCLASS_USERGETATTR_FLAG) & EXTENSIONCLASS_USERGETATTR_FLAG)
) )
...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = { ...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = {
PERSISTENCE_FLAGS, PERSISTENCE_FLAGS,
}; };
static PyExtensionClass Overridable = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"Persistent", /*tp_name*/
sizeof(cPersistentObject), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
(destructor)Per_dealloc, /*tp_dealloc*/
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
(cmpfunc)0, /*tp_compare*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
(hashfunc)0, /*tp_hash*/
(ternaryfunc)0, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)Per_getattro, /*tp_getattr with object key*/
(setattrofunc)Per_setattro, /*tp_setattr with object key*/
/* Space for future expansion */
0L,0L,"",
METHOD_CHAIN(Per_methods),
EXTENSIONCLASS_BASICNEW_FLAG | PERSISTENT_TYPE_FLAG
};
/* End of code for Persistent objects */ /* End of code for Persistent objects */
/* -------------------------------------------------------- */ /* -------------------------------------------------------- */
...@@ -785,7 +812,7 @@ void ...@@ -785,7 +812,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.38 $"; char *rev="$Revision: 1.39 $";
TimeStamp=PyString_FromString("TimeStamp"); TimeStamp=PyString_FromString("TimeStamp");
if (! TimeStamp) return; if (! TimeStamp) return;
...@@ -803,7 +830,8 @@ initcPersistence() ...@@ -803,7 +830,8 @@ initcPersistence()
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
PyDict_SetItemString(d,"__version__", PyDict_SetItemString(d,"__version__",
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
PyExtensionClass_Export(d,"Persistent",Pertype); PyExtensionClass_Export(d, "Persistent", Pertype);
PyExtensionClass_Export(d, "Overridable", Overridable);
cPersistenceCAPI=&truecPersistenceCAPI; cPersistenceCAPI=&truecPersistenceCAPI;
PyDict_SetItemString(d, "CAPI", PyDict_SetItemString(d, "CAPI",
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.38 2000/05/30 17:27:43 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.39 2000/06/23 17:10:45 brian Exp $";
#include <string.h> #include <string.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name) ...@@ -554,7 +554,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
UNLESS(s=PyString_AsString(name)) return NULL; UNLESS(s=PyString_AsString(name)) return NULL;
r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro); r = Per_getattr(self, name, s, PyExtensionClassCAPI->getattro);
if (! r && if (! r && self->state != cPersistent_GHOST_STATE &&
(((PyExtensionClass*)(self->ob_type))->class_flags (((PyExtensionClass*)(self->ob_type))->class_flags
& EXTENSIONCLASS_USERGETATTR_FLAG) & EXTENSIONCLASS_USERGETATTR_FLAG)
) )
...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = { ...@@ -736,6 +736,33 @@ static PyExtensionClass Pertype = {
PERSISTENCE_FLAGS, PERSISTENCE_FLAGS,
}; };
static PyExtensionClass Overridable = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"Persistent", /*tp_name*/
sizeof(cPersistentObject), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
(destructor)Per_dealloc, /*tp_dealloc*/
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
(cmpfunc)0, /*tp_compare*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
(hashfunc)0, /*tp_hash*/
(ternaryfunc)0, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)Per_getattro, /*tp_getattr with object key*/
(setattrofunc)Per_setattro, /*tp_setattr with object key*/
/* Space for future expansion */
0L,0L,"",
METHOD_CHAIN(Per_methods),
EXTENSIONCLASS_BASICNEW_FLAG | PERSISTENT_TYPE_FLAG
};
/* End of code for Persistent objects */ /* End of code for Persistent objects */
/* -------------------------------------------------------- */ /* -------------------------------------------------------- */
...@@ -785,7 +812,7 @@ void ...@@ -785,7 +812,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.38 $"; char *rev="$Revision: 1.39 $";
TimeStamp=PyString_FromString("TimeStamp"); TimeStamp=PyString_FromString("TimeStamp");
if (! TimeStamp) return; if (! TimeStamp) return;
...@@ -803,7 +830,8 @@ initcPersistence() ...@@ -803,7 +830,8 @@ initcPersistence()
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
PyDict_SetItemString(d,"__version__", PyDict_SetItemString(d,"__version__",
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
PyExtensionClass_Export(d,"Persistent",Pertype); PyExtensionClass_Export(d, "Persistent", Pertype);
PyExtensionClass_Export(d, "Overridable", Overridable);
cPersistenceCAPI=&truecPersistenceCAPI; cPersistenceCAPI=&truecPersistenceCAPI;
PyDict_SetItemString(d, "CAPI", PyDict_SetItemString(d, "CAPI",
......
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