@@ -200,7 +200,7 @@ def on_event(self, event: InotifyEvent) -> None:
200200 return
201201 src_path = self ._build_event_source_path (event )
202202
203- # todo look into desired behavior for IN_MOVE_SELF events (keep watching?, stop watching?)
203+ # todo look into desired behavior for IN_MOVE_SELF events (keep watching?, stop watching?, are they even possible? )
204204 if event .is_moved_from :
205205 # TODO: When a directory from a watched directory
206206 # is moved into another part of the filesystem, this
@@ -244,14 +244,12 @@ def _recursive_simulate(self, src_path: bytes) -> list[InotifyEvent]:
244244 for dirname in dirnames :
245245 full_path = os .path .join (root , dirname )
246246 wd_dir = self ._active_callbacks_by_path [os .path .dirname (full_path )]
247- # todo handle missing callback because a subfolder has been created between self._add_all_callbacks(src_path) and this line of code.
248247 mask = Mask (InotifyConstants .IN_CREATE | InotifyConstants .IN_ISDIR )
249248 events .append (InotifyEvent (wd_dir , mask , 0 , dirname ))
250249
251250 for filename in filenames :
252251 full_path = os .path .join (root , filename )
253252 wd_parent_dir = self ._active_callbacks_by_path [os .path .dirname (full_path )]
254- # todo handle missing callback because a subfolder has been created between self._add_all_callbacks(src_path) and this line of code.
255253 mask = InotifyConstants .IN_CREATE
256254 events .append (InotifyEvent (wd_parent_dir , mask , 0 , filename ))
257255 return events
@@ -278,7 +276,8 @@ def _activate(self) -> None:
278276
279277 def _build_event_source_path (self , event : InotifyEvent ) -> bytes | None :
280278 watched_path = self ._active_callbacks_by_watch .get (event .wd )
281- if watched_path is None : # todo investigate: can we *actually* get events for WatchDescriptor that have already been removed?
279+ if watched_path is None :
280+ # investigate: can we *actually* get events for a WatchDescriptor that has already been removed?
282281 return None
283282 return os .path .join (watched_path , event .name ) if event .name else watched_path # avoid trailing slash
284283
0 commit comments