Primitive monitor which checks whether new data is added to disk.

def diskMonitor(self):
        '''Primitive monitor which checks whether new data is added to disk.'''

        while self.loop():
            try:
                newest = max(glob.iglob("%s/*" % (self.kwargs.directory)), key=os.path.getmtime)
            except Exception:
                pass
            else:
                if time() - os.path.getctime(newest) >= self.kwargs.idle_time:
                    self.reading.set()
                else:
                    self.reading.clear()
            sleep(1)