Skip to content

Commit

Permalink
WindowsApiEmitter made easier to subclass.
Browse files Browse the repository at this point in the history
queue_events now does not call read_events directly. The call
was put into a member function _read_events instead, to make
it easier to replace the read_events functionality while keeping
the rest of the class going.
  • Loading branch information
petrblahos authored and BoboTiG committed Oct 13, 2018
1 parent eea9b69 commit cedf21a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/watchdog/observers/read_directory_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ def on_thread_stop(self):
if self._handle:
close_directory_handle(self._handle)

def _read_events(self):
return read_events(self._handle, self.watch.is_recursive)

def queue_events(self, timeout):
winapi_events = read_events(self._handle, self.watch.is_recursive)
winapi_events = self._read_events()
with self._lock:
last_renamed_src_path = ""
for winapi_event in winapi_events:
Expand Down

0 comments on commit cedf21a

Please sign in to comment.