Пример #1
0
class PersistentMonitor(AbstractMonitor):

    """
        A Thread to monitor a path.

        :group Constructor: __init__
        :group Other methods: run, stop

    """

    def __init__(self, eventTypes, pathMode, pathString, whitelist, blacklist,
                 timeout, blockSize, ignoreSysFiles, ignoreDirEvents,
                 platformCheck, proxy, monitorId):
        """
            Initialise Monitor.

        """
        AbstractMonitor.__init__(
            self, eventTypes, pathMode, pathString, whitelist, blacklist,
            ignoreSysFiles, ignoreDirEvents, platformCheck, proxy, monitorId)

        self.notifier = NotificationScheduler(
            self.proxy, self.monitorId, timeout, blockSize)
        self.notifier.start()

    def start(self):
        """
            Start monitoring.

            :return: No explicit return value.

        """
        self.pMonitor.start()

    def stop(self):
        """
            Stop monitoring

            :return: No explicit return value.

        """
        self.pMonitor.stop()

    def callback(self, eventList):
        """
            Callback used by ProcessEvent methods

            :Parameters:

                eventList : string
                File paths of the event.

            :return: No explicit return value.

        """
        self.notifier.schedule(eventList)
Пример #2
0
    def __init__(self, eventTypes, pathMode, pathString, whitelist, blacklist, timeout, blockSize,
                    ignoreSysFiles, ignoreDirEvents, proxy, monitorId):
 
        """
            Initialise Monitor.
                                 
        """
        AbstractMonitor.__init__(self, eventTypes, pathMode, pathString, whitelist, blacklist, 
                            ignoreSysFiles, ignoreDirEvents, proxy, monitorId)
        
        self.notifier = NotificationScheduler(self.proxy, self.monitorId, timeout, blockSize)
        self.notifier.start()
Пример #3
0
    def __init__(self, eventTypes, pathMode, pathString, whitelist, blacklist, timeout, blockSize,
                    ignoreSysFiles, ignoreDirEvents, proxy, monitorId):
 
        """
            Initialise Monitor.
                                 
        """
        AbstractMonitor.__init__(self, eventTypes, pathMode, pathString, whitelist, blacklist, 
                            ignoreSysFiles, ignoreDirEvents, proxy, monitorId)
        
        self.notifier = NotificationScheduler(self.proxy, self.monitorId, timeout, blockSize)
        self.notifier.start()