A Friday 03 December 2010 18:37:43 Anthony Scopatz escrigué: > Hello All, > > I was wondering if there was a pytables way to fire an event whenever > something happens to a tables.File object. For example, I would like > to be able to be informed whenever a createArray(), createGroup(), > etc are called or a table or array is modified in any way. It seems > that the undo/redo functionality partially captures this. Anyone > have any hints or suggestions?
Yes, the do/undo machinery is already capturing this (among other events). If you are only interested in triggering an action on node creation, I'd say that it would enough to add the trigger in Node._g_logCreate() (or add a new call for each self._g_logCreate() call and setup a new boolean function similar to File.isUndoEnabled()). IIRC, it is currently not possible to capture the table/array modification events, but it should be easy to add support for this (just by mimicking the do/undo functionality). If you end with a patch for this, tell me and I'll see if I can accommodate it officially. > The motivation for this is to have pytables hook nicely in Traits. Looks like a nice application. Luck! -- Francesc Alted ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users