[Cubicweb] Foaf implementation

Stéphane Bugat stephane.bugat at free.fr
Wed Jul 18 16:11:10 CEST 2012

Yes Sylvain, I should rather write a unittest but actually I use those small scripts to create a small database and perform some tests with it using the web interface afterwards... But I do admit that this kind of trial/error operation is not correct.

No, there is no infinite loop. I forgot to mention that I also tried it with an empty __call__() method for the sync hook (do nothing and just returns), and the problem remains the same...

Anyhow, I guess I'll have to provide unittest for this cube sooner or later, so I will focus on that in the meantime.

----- Mail original -----
De: "Sylvain Thénault" <sylvain.thenault at logilab.fr>
À: "Stéphane Bugat" <stephane.bugat at free.fr>
Cc: "Nicolas Chauvat" <nicolas.chauvat at logilab.fr>, cubicweb at lists.cubicweb.org
Envoyé: Mercredi 18 Juillet 2012 15:24:22
Objet: Re: [Cubicweb] Foaf implementation

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 ( - Toulouse (
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