#NEWLINE# def build_zip( self , include_src = False ) : #NEWLINE# #INDENT# 'Build the zip file (with name `self.zip_name`) in the\n        current directory.\n\n        Parameters\n        ----------\n\n        - include_src : `bool` (default: False)\n\n          If True, also includes all the ``*.py`` files in the ZIP file.\n          By default only the ``*.pyc`` files are included.\n\n        ' #NEWLINE# cwd = os . getcwd ( ) #NEWLINE# d = os . path . dirname ( self . out_dir ) #NEWLINE# os . chdir ( d ) #NEWLINE# z = zipfile . PyZipFile ( self . zip_name , 'w' , zipfile . ZIP_DEFLATED ) #NEWLINE# if include_src : #NEWLINE# #INDENT# l = glob . glob ( os . path . join ( 'tvtk_classes' , '*.py' ) ) #NEWLINE# for x in l : #NEWLINE# #INDENT# fname = os . path . basename ( x ) #NEWLINE# z . write ( x , ( 'tvtk_classes/%s' % fname ) ) #NEWLINE# #UNINDENT# #UNINDENT# z . writepy ( 'tvtk_classes' ) #NEWLINE# z . close ( ) #NEWLINE# if os . path . exists ( ( ( cwd + '/' ) + self . zip_name ) ) : #NEWLINE# #INDENT# os . unlink ( ( ( cwd + '/' ) + self . zip_name ) ) #NEWLINE# #UNINDENT# shutil . move ( self . zip_name , cwd ) #NEWLINE# os . chdir ( cwd )