#NEWLINE# def generate_code( self ) : #NEWLINE# #INDENT# 'Generate all the wrapper code in `self.out_dir`.\n        ' #NEWLINE# out_dir = self . out_dir #NEWLINE# helper_gen = self . helper_gen #NEWLINE# wrap_gen = self . wrap_gen #NEWLINE# f = open ( os . path . join ( out_dir , '__init__.py' ) , 'w' ) #NEWLINE# f . close ( ) #NEWLINE# v = vtk . vtkVersion ( ) #NEWLINE# vtk_version = v . GetVTKVersion ( ) [ : 3 ] #NEWLINE# vtk_src_version = v . GetVTKSourceVersion ( ) #NEWLINE# code = ( "vtk_build_version = '%s'\n" % vtk_version ) #NEWLINE# code += ( "vtk_build_src_version = '%s'\n" % vtk_src_version ) #NEWLINE# f = open ( os . path . join ( out_dir , 'vtk_version.py' ) , 'w' ) #NEWLINE# f . write ( code ) #NEWLINE# f . close ( ) #NEWLINE# helper_file = open ( os . path . join ( out_dir , 'tvtk_helper.py' ) , 'w' ) #NEWLINE# helper_gen . write_prelims ( helper_file ) #NEWLINE# tree = wrap_gen . get_tree ( ) . tree #NEWLINE# classes = [ ] #NEWLINE# for node in wrap_gen . get_tree ( ) : #NEWLINE# #INDENT# name = node . name #NEWLINE# if ( ( not name . startswith ( 'vtk' ) ) or name . startswith ( 'vtkQt' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( not hasattr ( vtk , name ) ) or ( not hasattr ( getattr ( vtk , name ) , 'IsA' ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# classes . append ( name ) #NEWLINE# #UNINDENT# for nodes in tree : #NEWLINE# #INDENT# for node in nodes : #NEWLINE# #INDENT# if ( node . name in classes ) : #NEWLINE# #INDENT# tvtk_name = get_tvtk_name ( node . name ) #NEWLINE# self . _write_wrapper_class ( node , tvtk_name ) #NEWLINE# helper_gen . add_class ( helper_gen , helper_file ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# helper_file . close ( )