def watch_files(self):
try:<EOL><INDENT>while <NUM_LIT:1>:<EOL><INDENT>sleep(<NUM_LIT:1>)  <EOL>try:<EOL><INDENT>files_stat = self.get_files_stat()<EOL><DEDENT>except SystemExit:<EOL><INDENT>logger.error("<STR_LIT>")<EOL>self.shutdown_server()<EOL><DEDENT>if self.files_stat != files_stat:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>try:<EOL><INDENT>generator.re_generate()<EOL>global _root<EOL>_root = generator.root<EOL><DEDENT>except SystemExit:  <EOL><INDENT>logger.error("<STR_LIT>")<EOL>self.shutdown_server()<EOL><DEDENT>self.files_stat = files_stat  <EOL><DEDENT><DEDENT><DEDENT>except KeyboardInterrupt:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>self.shutdown_watcher()<EOL><DEDENT>
watch files for changes, if changed, rebuild blog. this thread
        will quit if the main process ends