#NEWLINE# def monitor_once( self , execute = True ) : #NEWLINE# #INDENT# for f in self . files : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# mtime = os . stat ( f ) . st_mtime #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# time . sleep ( 1 ) #NEWLINE# mtime = os . stat ( f ) . st_mtime #NEWLINE# #UNINDENT# if ( f not in self . mtimes . keys ( ) ) : #NEWLINE# #INDENT# self . mtimes [ f ] = mtime #NEWLINE# continue #NEWLINE# #UNINDENT# if ( mtime > self . mtimes [ f ] ) : #NEWLINE# #INDENT# if self . verbose : #NEWLINE# #INDENT# print ( ( 'File changed: %s' % os . path . realpath ( f ) ) ) #NEWLINE# #UNINDENT# self . mtimes [ f ] = mtime #NEWLINE# if execute : #NEWLINE# #INDENT# self . execute ( ) #NEWLINE# break