(self)
Prune the contents of the database.

        This removes warnings that are no longer valid. A warning is no longer
        valid if the file it was in no longer exists or if the content has
        changed.

        The check for changed content catches the case where a file previously
        contained warnings but no longer does.
Prune the contents of the database.
Prune the contents of the database .
def prune(self):
        """Prune the contents of the database.

        This removes warnings that are no longer valid. A warning is no longer
        valid if the file it was in no longer exists or if the content has
        changed.

        The check for changed content catches the case where a file previously
        contained warnings but no longer does.
        """

        # Need to calculate up front since we are mutating original object.
        filenames = self._files.keys()
        for filename in filenames:
            if not os.path.exists(filename):
                del self._files[filename]
                continue

            if self._files[filename]['hash'] is None:
                continue

            current_hash = hash_file(filename)
            if current_hash != self._files[filename]['hash']:
                del self._files[filename]
                continue
def prune ( self ) : # Need to calculate up front since we are mutating original object. filenames = self . _files . keys ( ) for filename in filenames : if not os . path . exists ( filename ) : del self . _files [ filename ] continue if self . _files [ filename ] [ 'hash' ] is None : continue current_hash = hash_file ( filename ) if current_hash != self . _files [ filename ] [ 'hash' ] : del self . _files [ filename ] continue