[vtk-developers] vtkMathTextUtilities and otherPrint test

David Lonie david.lonie at kitware.com
Tue Jul 10 13:22:22 EDT 2012


Thanks David,

I've a patch on the way, just checking that it builds ok now...

On Tue, Jul 10, 2012 at 12:47 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> David, how about moving all of the python initialization and
> module-loading code into a method called "Initialize" that checks if
> this->Parser is set, and if not, calls PyInitialize() and loads the
> modules?  Then Initialize() can be called from RenderString().  The
> idea is that none of the python initialization should be done from the
> constructor.

I've split it into two functions, one that initializes python and
another that instantiates the parser (This is needed for some local
patches that I'm working on).

> Curly braces should also be added around any "if" bodies that are
> currently lacking them.  I'm not fond of the goto's either, but I
> don't know if the VTK style guidelines forbid them.  The curly-braces,
> however, are definitely part of the guidelines...

Ah, I had assumed that they could be omitted for single line bodies,
but the style guide doesn't say that. I'll fix them.

I'm not crazy about gotos either. However, it seems like the cleanest
and most readable/maintainable solution to error cleanup in this case.
I'm open to alternatives if there is an issue.

Dave



More information about the vtk-developers mailing list