コード例 #1
0
ファイル: watcher.py プロジェクト: timbertson/file-finder
	def __init__(self, root, event_queue, ignored_dir_regexes=()):
		self._dir_queue = queue.Queue()
		self._root = os.path.realpath(root)

		# Add a watch to the root of the dir
		self._handler = FileFinderEventHandler(event_queue=event_queue, directory_queue=self._dir_queue, root=self._root)
		notifier = Observer()
		notifier.name = "[inotify] notifier"
		notifier.daemon = True
		self.notifier = notifier
		self._ignored_dir_res = ignored_dir_regexes