#NEWLINE# def run( self ) : #NEWLINE# #INDENT# 'Reload the process if registered files have been modified.' #NEWLINE# for filename in ( self . sysfiles ( ) | self . files ) : #NEWLINE# #INDENT# if filename : #NEWLINE# #INDENT# if filename . endswith ( '.pyc' ) : #NEWLINE# #INDENT# filename = filename [ : ( - 1 ) ] #NEWLINE# #UNINDENT# oldtime = self . mtimes . get ( filename , 0 ) #NEWLINE# if ( oldtime is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# mtime = os . stat ( filename ) . st_mtime #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# mtime = None #NEWLINE# #UNINDENT# if ( filename not in self . mtimes ) : #NEWLINE# #INDENT# self . mtimes [ filename ] = mtime #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( mtime is None ) or ( mtime > oldtime ) ) : #NEWLINE# #INDENT# self . bus . log ( ( 'Restarting because %s changed.' % oldtime ) ) #NEWLINE# self . thread . cancel ( ) #NEWLINE# self . bus . log ( ( 'Stopped thread %r.' % self . thread . getName ( ) ) ) #NEWLINE# self . bus . restart ( ) #NEWLINE# return