Francesc Alted wrote: > Hi Gabriel, > > Your message has not entered the list properly and bounced (mail sent > from unsubscribed address?). I'm replying to it here. > > Gabriel J.L. Beckers wrote: >> Hi list, > >> In my code I would like to enforce the use of names that adhere to >> the natural naming principle of PyTables. But how to check this >> conveniently? >> >> I found the tables.checkNameValidity() function. However it raises an >> error if the name is not valid, and only prints a warning if it is >> not a valid natural name, and that only the first time it is used. >> Ideally I would like to use some function that checks whether or not >> an object/string is a valid natural name, and returns a False/True. >> Does something like that exist? Or can I somehow check for the >> warning that is raised? > > No, there is not a routine that does what you want. In fact, the > function ``tables.checkNameValidity()`` is only meant for internal use. > I think the routine that you need can be obtained quite easily from the > above one. Feel free to open a ticket so that I can track it later on > (if you end with an implementation, please attach it to the ticket). >
Wouldn't this work? import warnings warnings.filterwarnings('error', category=tables.NaturalNameWarning) ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users