#NEWLINE# def check_reload( self ) : #NEWLINE# #INDENT# filenames = list ( self . extra_files ) #NEWLINE# for file_callback in self . file_callbacks : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# filenames . extend ( file_callback ( ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# print ( ( 'Error calling paste.reloader callback %r:' % file_callback ) , file = sys . stderr ) #NEWLINE# traceback . print_exc ( ) #NEWLINE# #UNINDENT# #UNINDENT# for module in sys . modules . values ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# filename = module . __file__ #NEWLINE# #UNINDENT# except ( AttributeError , ImportError ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( filename is not None ) : #NEWLINE# #INDENT# filenames . append ( filename ) #NEWLINE# #UNINDENT# #UNINDENT# for filename in filenames : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# stat = os . stat ( filename ) #NEWLINE# if stat : #NEWLINE# #INDENT# mtime = stat . st_mtime #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mtime = 0 #NEWLINE# #UNINDENT# #UNINDENT# except ( OSError , IOError ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( filename . endswith ( '.pyc' ) and os . path . exists ( filename [ : ( - 1 ) ] ) ) : #NEWLINE# #INDENT# mtime = max ( os . stat ( filename [ : ( - 1 ) ] ) . st_mtime , mtime ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( filename . endswith ( '$py.class' ) and os . path . exists ( ( filename [ : ( - 9 ) ] + '.py' ) ) ) : #NEWLINE# #INDENT# mtime = max ( os . stat ( ( filename [ : ( - 9 ) ] + '.py' ) ) . st_mtime , mtime ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not self . module_mtimes . has_key ( filename ) ) : #NEWLINE# #INDENT# self . module_mtimes [ filename ] = mtime #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . module_mtimes [ filename ] < mtime ) : #NEWLINE# #INDENT# print ( ( '%s changed; reloading...' % filename ) , file = sys . stderr ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return True