def changes(self):
deleted = []<EOL>for path in list(self.files):<EOL><INDENT>isdir = path.endswith(os.sep)<EOL>abspath = os.path.join(self.path, path)<EOL>try:<EOL><INDENT>is_deleted = (<EOL>not os.path.exists(abspath) or  <EOL>os.path.isdir(abspath) != isdir  <EOL>)<EOL><DEDENT>except EnvironmentError:<EOL><INDENT>is_deleted = True<EOL><DEDENT>if is_deleted:<EOL><INDENT>deleted.append(path)<EOL>del self.files[path]<EOL><DEDENT><DEDENT>changed = []<EOL>for folder, subfolders, subfiles in os.walk(self.path):<EOL><INDENT>for path in subfolders:<EOL><INDENT>path = os.path.join(folder, path)<EOL>path = os.path.normcase(os.path.relpath(path, self.path))<EOL>path += os.sep<EOL>if path not in self.files:<EOL><INDENT>self.files[path] = <NUM_LIT:0><EOL>changed.append(path)<EOL><DEDENT><DEDENT>for path in subfiles:<EOL><INDENT>actual_path = path = os.path.join(folder, path)<EOL>path = os.path.normcase(os.path.relpath(path, self.path))<EOL>try:<EOL><INDENT>mtime = os.path.getmtime(actual_path)<EOL>if path not in self.files:<EOL><INDENT>self.files[path] = <NUM_LIT:0><EOL><DEDENT>if mtime > self.files[path]:<EOL><INDENT>self.files[path] = mtime<EOL>changed.append(path)<EOL><DEDENT><DEDENT>except EnvironmentError:<EOL><INDENT>if path in self.files:<EOL><INDENT>deleted.append(path)<EOL>del self.files[path]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.updated = False<EOL>return changed, deleted<EOL>
Collects all changes that have been performed on the monitored path,
        returning them as a (created, deleted) tuple.