def consider_file_size(fname, f): """Consider file size issues for 'f' and return True if a new issue was found""" file_size = metrics.get_file_len(f) if file_size > MAX_FILE_SIZE: p = problem.FileSizeProblem(fname, file_size) return ProblemVault.register_problem(p) return False
def consider_file_size(fname, f): """Consider the size of 'f' and yield an FileSizeItem for it. """ file_size = metrics.get_file_len(f) yield problem.FileSizeItem(fname, file_size)