Source code for cowbird.monitoring.fsmonitor

import abc


[docs]class FSMonitor(abc.ABC): """ Interface being called when something changes on the filesystem. """ @staticmethod @abc.abstractmethod
[docs] def get_instance(): """ Must return an instance of the class implementing FSMonitor. """ raise NotImplementedError
@abc.abstractmethod
[docs] def on_created(self, filename): # type: (str) -> None """ Call when a new file is found. :param filename: Relative filename of a new file """ raise NotImplementedError
@abc.abstractmethod
[docs] def on_deleted(self, filename): # type: (str) -> None """ Call when a file is deleted. :param filename: Relative filename of the removed file """ raise NotImplementedError
@abc.abstractmethod
[docs] def on_modified(self, filename): # type: (str) -> None """ Call when a file is updated. :param filename: Relative filename of the updated file """ raise NotImplementedError