def start(self):
assert not self.watching<EOL>def selector(evt):<EOL><INDENT>if evt.is_directory:<EOL><INDENT>return False<EOL><DEDENT>path = evt.path<EOL>if path in self._last_fnames: <EOL><INDENT>return False<EOL><DEDENT>for pattern in self.skip_pattern.split("<STR_LIT:;>"):<EOL><INDENT>if fnmatch(path, pattern.strip()):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>def watchdog_handler(evt):<EOL><INDENT>wx.CallAfter(self._watchdog_handler, evt)<EOL><DEDENT>self._watching = True<EOL>self._last_fnames = []<EOL>self._evts = [None]<EOL>self._run_subprocess()<EOL>from .watcher import watcher<EOL>self._watcher = watcher(path=self.directory,<EOL>selector=selector, handler=watchdog_handler)<EOL>self._watcher.__enter__()<EOL>
Starts watching the path and running the test jobs.