import thread, threading, traceback import svnNotify class fifoReader: def __init__( self, file, irc ): self.file = open( file, 'r+' ) self.irc = irc self.notify = svnNotify.svnNotify( irc ) self.stopEvent = threading.Event() def run( self ): while not self.stopEvent.isSet() : line = self.file.readline() try: data = eval( compile( line, '', 'eval' ) ) if data['type'] == 'reload' : reload( svnNotify ) self.notify = svnNotify.svnNotify( irc ) else : self.notify.handle( data ) except: traceback.print_exc() def start( self ): self.stopEvent.clear() thread.start_new_thread( self.run, () ) def stop( self ): self.stopEvent.set()