[Cubicweb] Foaf implementation

Sylvain Thénault sylvain.thenault at logilab.fr
Wed Jul 18 16:25:44 CEST 2012

On 18 juillet 16:11, Stéphane Bugat wrote:
> 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...

A unittest would allow us to easily reproduce your pb. Quickly looking at
your code, I see at least one potential infinite loop in syncUserPersonHook:
you edit a user, hook edits related person, hook edits related user, etc.

Tip (probably undocumented): add 'category = "synchronization" to your hook.
then, call set_attributes withing a 

  with self._cw.allow_all_hooks_but("synchronization"):

block. This would probably also apply to email sync hook.
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