#NEWLINE# def start( self ) : #NEWLINE# #INDENT# self . observer = Observer ( ) #NEWLINE# self . observer . schedule ( self , self . monitor_dir ) #NEWLINE# self . observer . start ( ) #NEWLINE# print ( ( 'Starting to watch for new pdfs in %s' % self . monitor_dir ) ) #NEWLINE# while True : #NEWLINE# #INDENT# logging . info ( ( 'Sleeping for %d seconds' % self . scan_interval ) ) #NEWLINE# time . sleep ( self . scan_interval ) #NEWLINE# newFile = self . check_queue ( ) #NEWLINE# if newFile : #NEWLINE# #INDENT# ( yield newFile ) #NEWLINE# #UNINDENT# #UNINDENT# self . observer . join ( )