def compute_hash(self): """Compute an MD5 hash from the text, for comparison purpose :return: MD5 hash of the text :rtype: str """ if self.text: return compute_hash([self.get_path()]) else: return compute_hash([])
def compute_hash(self): """Compute an MD5 hash from the introduction and conclusion, for comparison purpose :return: MD5 hash :rtype: str """ files = [] if self.introduction: files.append(os.path.join(self.top_container().get_path(), self.introduction)) if self.conclusion: files.append(os.path.join(self.top_container().get_path(), self.conclusion)) return compute_hash(files)