'Main function, see source.get_new_files().
:param _stat_func: Used for unit testing, if we stub os.stat in the
unit test then unit test failures get reported confusingly
because the unit test framework tries to stat() the unit test
file.'

def get_new_files(self, _stat_func=os.stat):

    all_files = {}
    for filename in os.listdir(self._path):
        full_filename = os.path.join(self._path, filename)
        try:
            stat_data = _stat_func(full_filename)
        except OSError:
            continue
        item = database.item(full_filename, stat_data.st_size, int(stat_data.st_mtime))
        all_files[filename] = item
    return self._get_new_files(all_files)
