Пример #1
0
    def start(self):

        #content.cleanup()
        #content.buildup()

        for path in self.paths:
            result = content.scan(path)

        self.notifier.start()
        self.running = True
        log.info('Monitor started.')

        self.timer.start()
Пример #2
0
    def partial_scan_for_recent_events(self):
        status = self.get_scan_status()

        # Monitor is idle.
        if status == True:
            # Some events happened after previous scanning.
            if not self.notifier._default_proc_fun.up_to_date:
                clog.debug('Some events occurred. Start scanning the below directories...')
                for dir in self.notifier._default_proc_fun.event_dir_list:
                    clog.debug('| %s |' % dir)

                clog.debug('=============== End of Event Dirs ===============')

                for dir in self.notifier._default_proc_fun.event_dir_list:
                    content.scan(dir)

                self.notifier._default_proc_fun.event_dir_list = []
                self.notifier._default_proc_fun.up_to_date = True

                clog.debug('Finished Partial Scanning...')

        self.timer = Timer(TIMER_INTERVAL, self.partial_scan_for_recent_events)
        self.timer.start()