#NEWLINE# def main( ) : #NEWLINE# #INDENT# parser = OptionParser ( ) #NEWLINE# parser . add_option ( '--pypy' , dest = 'pypy' , help = 'Path to PyPy libraries' ) #NEWLINE# parser . add_option ( '--cpython' , dest = 'cpython' , help = 'Path to CPython libraries' ) #NEWLINE# ( options , args ) = parser . parse_args ( ) #NEWLINE# if ( not options . cpython ) : #NEWLINE# #INDENT# cpython_path = dirname ( os . __file__ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cpython_path = options . cpython #NEWLINE# #UNINDENT# pypy_path = options . pypy #NEWLINE# print ( 'Exporting data from:\nPyJS lib: {0}\nPyPy lib: {2}\nCPython lib: {1}\n' . format ( pyjslib_path , cpython_path , options ) ) #NEWLINE# if exists ( dest_path ) : #NEWLINE# #INDENT# shutil . rmtree ( dest_path ) #NEWLINE# #UNINDENT# os . mkdir ( dest_path ) #NEWLINE# copy_libs ( dest_path , pyjslib_path , 'pyjs' , pyjslib_excludes ) #NEWLINE# if pypy_path : #NEWLINE# #INDENT# copy_libs ( dest_path , pypy_path , 'pypy' , pypy_excludes ) #NEWLINE# #UNINDENT# copy_libs ( dest_path , cpython_path , 'cpython' , cpython_excludes ) #NEWLINE# f_mod_src = open ( join ( dest_path , 'modules_sources' ) , 'w' ) #NEWLINE# for ( mod , src ) in mod_src . iteritems ( ) : #NEWLINE# #INDENT# f_mod_src . write ( '{}:{}\n' . format ( mod , src ) ) #NEWLINE# #UNINDENT# f_mod_src . close ( )