[Cubicweb] Foaf implementation

Sylvain Thénault sylvain.thenault at logilab.fr
Wed Jul 18 15:24:22 CEST 2012


On 18 juillet 14:46, Stéphane Bugat wrote:
> Yes, absolutely, although this network is dedicated to a certain population... I'll have a look at your talk to check if the gap between what you wanted and what I would like to do is important or not.
> 
> I've put as promised on bitbucket a first draft of the source code: https://bitbucket.org/sbugat/foaf/overview
> 
> I have a real problem although: the hook written to synchronise emails between CWUser and the associated Person does not work. I have written a small script (see script_test.py) that creates a CWUser, and associates an email with it. When launched with cubicweb-ctl shell, the script does not stop nor outputs any error...

you should rather write a unittest test instead. See http://docs.cubicweb.org/devrepo/testing.html
 
> I've tried to select on match_rtype('primary_email') or match_rtype('use_email') but none of these two works. I really can't figure out why... Removing the syncEmailsHook in hooks.py works fine and the script ends properly.

I've not looked at your code, but that smells an infinite loop (eg you set user's email
address, your hook set associated person's email, then your hook attempt to set associated
user's email, etc.). Missing safety belt?
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the Cubicweb mailing list