E&S CVS Commit: PEAK - First phase of descriptor refactoring. Once bindings now place a proxy for

pje at eby-sarna.com pje at eby-sarna.com
Mon Jun 16 17:29:00 EDT 2003


Module Name:	PEAK
Committed By:	pje
Date:		Mon Jun 16 21:37:39 UTC 2003

Modified Files:
	PEAK/src/peak/binding: _once.c _once.pyx components.py once.py

Log Message:
First phase of descriptor refactoring.  Once bindings now place a proxy for
themselves in a class when activated in that class.  This avoids the need
for Once-derivatives to "copy" themselves when they are found under more
than one name (e.g in the same class or when they are created without a
name initially).  Eventually this will let us do something similar with
model.StructuralFeature objects.  Added hooks to the Once class family to
allow an 'onSet()' method to be called that can alter a value being
setattr'd.  This will let us do automatic 'adapt()' and
'setParentComponent()' when attributes are set or looked up.

Also, simplified the structure of the Pyrex OnceDescriptor base, using
Pyrex 0.7.2's ability to declare C-level attributes visible from Python.
(Previously, we used a custom descriptor to deal with this.)

NOTE: Error checking of bindings is partly BROKEN right now; bindings do
not verify that they haven't been placed in a class that doesn't support
them; they only verify that they have been told what name to use.  This
needs a little review, and the tutorial may need to be adjusted as well.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/binding/_once.c.diff?r1=1.7&r2=1.8
http://cvs.eby-sarna.com/PEAK/src/peak/binding/_once.pyx.diff?r1=1.7&r2=1.8
http://cvs.eby-sarna.com/PEAK/src/peak/binding/components.py.diff?r1=1.118&r2=1.119
http://cvs.eby-sarna.com/PEAK/src/peak/binding/once.py.diff?r1=1.51&r2=1.52

To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/binding/_once.c \
    PEAK/src/peak/binding/_once.pyx
cvs rdiff -r1.118 -r1.119 PEAK/src/peak/binding/components.py
cvs rdiff -r1.51 -r1.52 PEAK/src/peak/binding/once.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list