#NEWLINE# def visit_end( self ) : #NEWLINE# #INDENT# def static_code( libs , msg = None ) : #NEWLINE# #INDENT# code = [ ] #NEWLINE# for lib in libs : #NEWLINE# #INDENT# fname = lib #NEWLINE# if ( not os . path . isfile ( fname ) ) : #NEWLINE# #INDENT# fname = os . path . join ( self . output , lib ) #NEWLINE# #UNINDENT# if ( not os . path . isfile ( fname ) ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'File not found %r' % lib ) ) #NEWLINE# #UNINDENT# if ( fname [ len_ouput_dir : ] == self . output ) : #NEWLINE# #INDENT# name = fname [ len_ouput_dir : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = os . path . basename ( lib ) #NEWLINE# #UNINDENT# if ( not ( msg is None ) ) : #NEWLINE# #INDENT# code . append ( ( '/* start %s: %s */' % ( msg , name ) ) ) #NEWLINE# #UNINDENT# f = file ( fname ) #NEWLINE# code . append ( f . read ( ) ) #NEWLINE# if ( not ( msg is None ) ) : #NEWLINE# #INDENT# code . append ( ( '/* end %s */' % ( name , ) ) ) #NEWLINE# #UNINDENT# self . remove_files [ fname ] = True #NEWLINE# fname = fname . split ( '.' ) #NEWLINE# if ( fname [ ( - 2 ) ] == ( '__%s__' % platform_name ) ) : #NEWLINE# #INDENT# del fname [ ( - 2 ) ] #NEWLINE# fname = '.' . join ( fname ) #NEWLINE# if os . path . isfile ( fname ) : #NEWLINE# #INDENT# self . remove_files [ fname ] = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return '\n' . join ( code ) #NEWLINE# #UNINDENT# done = self . done [ PLATFORM ] #NEWLINE# module_files = str ( done ) [ 1 : ( - 1 ) ] #NEWLINE# js_lib_files = str ( self . js_libs ) [ 1 : ( - 1 ) ] #NEWLINE# early_static_js_libs = str ( self . js_libs ) [ 1 : ( - 1 ) ] #NEWLINE# late_static_js_libs = ( [ ] + self . late_static_js_libs ) #NEWLINE# late_static_js_libs = static_code ( late_static_js_libs , 'javascript lib' ) #NEWLINE# app_name = self . top_module #NEWLINE# available_modules = self . visited_modules [ PLATFORM ] #NEWLINE# out_file = open ( os . path . join ( self . output , ( self . top_module + pyjs . MOD_SUFFIX ) ) , 'w' ) #NEWLINE# out_file . write ( ( APP_TEMPLATE % locals ( ) ) ) #NEWLINE# out_file . close ( )