[ZPatterns] cPersistence 3.2 -> 3.4 somewhere (was Anybody still on this list?)

Steve Spicklemire steve at spvi.com
Mon Dec 18 22:16:49 EST 2006


Thanks...

I'm not bent on eliminating DynPersist, it's just that I have a lot  
of code that uses it now... and I'm fearing that it won't work past  
Zope-2.7. The trouble seems to be that cPersistence has changed along  
the way somewhere, and they've apparently removed some of the slots  
in the cPersistenceCAPIstruct that DynPersist uses to do its magic.  
I'm not sure if it's possible to emulate those.. or what. I (still)  
love being able to use SkinScript and DataSkins to re-wire my data to  
my objects any which way I like. I also make a lot of use of the per- 
transaction caching behavior of DataSkin's attribute providers.  
Sigh... Here's a comparison between ZODB 3.2 and ZODB 3.4. Any  
thoughts you may have are appreciated!

thanks,
-steve

(Here's a diff of cPersistence.h between ZODB 3.2 and 3.4,  
corresponding to Zope 2.7.x and 2.8.y where x and y are not totally  
clear to me).

typedef struct  
{                                                typedef struct {
     cPersistent_HEAD                                                 
cPersistent_HEAD
} cPersistentObject;                                            }  
cPersistentObject;

typedef int (*persetattr)(PyObject *, PyObject*, PyObject *,  |  
typedef void (*percachedelfunc)(PerCache *, PyObject *);
typedef PyObject *(*pergetattr)(PyObject *, PyObject*, char * <
typedef int (*percachedelfunc)(PerCache *, PyObject *);       <

typedef struct  
{                                                typedef struct {
     PyMethodChain *methods;                                   |      
PyTypeObject *pertype;
     getattrofunc getattro;                                           
getattrofunc getattro;
     setattrofunc setattro;                                           
setattrofunc setattro;
     int (*changed)(cPersistentObject*);                              
int (*changed)(cPersistentObject*);
     void (*accessed)(cPersistentObject*);                            
void (*accessed)(cPersistentObject*);
     void (*ghostify)(cPersistentObject*);                            
void (*ghostify)(cPersistentObject*);
     void (*deallocated)(cPersistentObject*);                  <
     int (*setstate)(PyObject*);                                      
int (*setstate)(PyObject*);
     pergetattr pergetattro;                                   <
     persetattr persetattro;                                   <
     percachedelfunc percachedel;                                     
percachedelfunc percachedel;
} cPersistenceCAPIstruct;                                       }  
cPersistenceCAPIstruct;

                                                               >  
#define cPersistenceType cPersistenceCAPI->pertype
                                                               >
#ifndef DONT_USE_CPERSISTENCECAPI                                
#ifndef DONT_USE_CPERSISTENCECAPI
static cPersistenceCAPIstruct *cPersistenceCAPI;                 
static cPersistenceCAPIstruct *cPersistenceCAPI;
#endif                                                          #endif

#define cPersistanceModuleName "cPersistence"                    
#define cPersistanceModuleName "cPersistence"


On Dec 18, 2006, at 6:10 PM, Phillip J. Eby wrote:

> At 03:33 PM 12/18/2006 -0500, Steve Spicklemire wrote:
>
>> Hi Folks,
>>
>> I was just curious to see if anyone was still on this list. If so..
>> I'm interested in getting ZPatterns to work in more recent versions
>> of Python/Zope. So far I've got it built with Python-2.3/Zope-2.7.9.
>> I'm wondering if it might be possible to dispense with DynPersist.
>
> Um, maybe?  :)
>
>
>>  I
>> know that was the intention at one time. Let me know if you have
>> thoughts about this!
>
> Gosh, it's been so many years.  Taking a quick glance at:
>
> http://cvs.eby-sarna.com/ZProducts/ZPatterns/DynPersist.c? 
> rev=1.7&view=markup
>
> it seems to me that the __set_attr__ and __del_attr__ hooks could  
> be implemented in pure Python since Python 2.2, assuming that Zope  
> was no longer using ExtensionClass for persistence.  Not so sure  
> about the __get_attr__ hook, or how any of this should work with  
> today's Zope or ZODB; I haven't used them in absolutely ages,  
> except running one Plone site for my business (doing no custom  
> coding at all).
>
> _______________________________________________
> ZPatterns mailing list
> ZPatterns at eby-sarna.com
> http://www.eby-sarna.com/mailman/listinfo/zpatterns
>



More information about the ZPatterns mailing list