[clam-devel] ConfigurationProxy: següent passa

Xavier Serra Román xvr.serra at gmail.com
Thu May 26 13:33:34 PDT 2011


On May 26, 2011, at 10:13 PM, David García Garzón wrote:

> Forwarded to the list, sorry, the original message from Xavi was in catalan.
> 
> A Dijous 26 Maig 2011 18:22:17, Xavier Serra Román va escriure:
>> Ei David!
>> l'altre dia vam parlar del camí a seguir amb el configuration i vas dir
>> Add, Removes... Amb això vols dir per exemple:
>> proxy["new_attribute"] = 'newvalue' ?
>> Fins ara sempre consideravem això com a AttributeError. I en cas afirmatiu,
>> com es fa? He vist el AddAttr_ de la interfície de DynamicType però pren
>> dos valors enters i és protected
>> 
>> Bye!
> 
> We should concentrate first in being able to do the same things that we support 
> right now with dummy: Plain type checked attributes but no optionality (the 
> add/remove thing you asked) and no composite attributes. Looking at the source 
> i still miss some features for the clam config proxy:
> - Errors on accessing wrong attribs should match the ones raised by dummy
> - implement __setitem__ to set the config value.
> - Error on type missmatch al __setitem__
> - keys()
> 
> Once this is done, comparing dummy and clam tests they should be quite 
> uniform. We can postpone optional and composite attributes implementation 
> while going forward to something that it is usable yet, that is, being able to 
> inspect the configuration of an actual processing inside a network and 
> reconfiguring it. So lets consider how to implement 
> Clam_NetworkProxy::processingConfig, first to get the actual configuration, then 
> to modify it (how to apply the configuration which was a tricky issue).
> 
Been thinking about that. What do you think of creating a function inside Clam_NetworkProxy
that returns a ConfigurationProxy (something like the factory method we have inside
Clam_ConfigurationProxy) and then pass that method to the Configuration python object? It should
look something like this (in the Processing.py __init__): 
	self.__dict__["_config"] = Configuration.Configuration( proxy.processingConfigProxy(processingType) )

> Or midterm goal is being able to build an stereo cable network like that:
> 
> net.source = "AudioSource"
> net.source.NChannels = 2
> net.sink = "AudioSink"
> net.sink.NChannels = net.source.NChannels 
> net.source[0] > net.sink[0] 
> net.source[1] > net.sink[1] 
> 
> 
> -- 
> David García Garzón
> (Work) david dot garcia at upf anotherdot edu
> http://www.iua.upf.edu/~dgarcia




More information about the clam-devel mailing list