def _scan(self, trigger=True):
changed = False<EOL>files_seen = set()<EOL>os_path_join = os.path.join<EOL>for path in self.paths:<EOL><INDENT>for root, dirs, files in os.walk(path):<EOL><INDENT>for f in files:<EOL><INDENT>fpath = os_path_join(root, f)<EOL>if not self.is_valid_type(fpath):<EOL><INDENT>continue<EOL><DEDENT>files_seen.add(fpath)<EOL>if self._requires_new_modtime(fpath):<EOL><INDENT>self._watch_file(fpath, trigger)<EOL>changed = True<EOL><DEDENT><DEDENT><DEDENT>for f in self._watched_files:<EOL><INDENT>if f not in files_seen:<EOL><INDENT>self._unwatch_file(f, trigger)<EOL>changed = True<EOL><DEDENT><DEDENT><DEDENT>return changed<EOL>
Walks through the directory to look for changes of the given file
types.
Returns True if changes occurred (False otherwise).
Returns None if polling method isn't being used.