from pathlib import PosixPath
from . import pathresolver
+from . import _inotify
from .in_constants import constants, decode_mask, event_properties
from .watcher import NoFilesException, _make_getter
from .pathresolver import SymlinkLoopError, ConcurrentFilesystemModificationError
'''Register a watch to be .reconnect()'ed after event processing is finished'''
- def read(self, block=True
+ def read(self, block=True):
'''Read a list of queued inotify events.
- block: If block is false, return only those events that can be read immediately.
- bufsize: The buffer size to use to read events. Only meaningful if
- block is True. If bufsize is too small, an error will occur.
+ block: If block is false, return only those events that can be
# We call _inotify.read once at first. If we are expecting an
# IN_IGNORE, we read it again until we get all pening
# IN_IGNOREs. Secondly, if a
while do2 or self._pending_watch_removes > 0:
- for e in self._read_events(b
+ for e in self._read_events(b):
# only filter duplicate path_changed events to
# prevent hiding of bugs that may cause duplicate
# other events to be created.
events, self.events = self.events, 
- def _read_events(self, bufsize):
- for evt in _inotify.read(self.fd, bufsize):
+ def _read_events(self, block):
+ for evt in _inotify.read(self.fd, block=block):
eventiter = self._handle_descriptorless_event(evt)
# Do not just clear the list, but replace it, because the
# reconnect call can cause new pathwatches to require
+ # reconnection.
r, self._reconnect = self._reconnect, set()