def has_hash_of(self, destpath, code, package): """Determine if a file has the hash of the code.""" if destpath is not None and os.path.isfile(destpath): with openfile(destpath, "r") as opened: compiled = readfile(opened) hashash = gethash(compiled) if hashash is not None and hashash == self.comp.genhash(package, code): return compiled return None
def hashashof(self, destpath, code, package): """Determines if a file has the hash of the code.""" if destpath is not None and os.path.isfile(destpath): with openfile(destpath, "r") as opened: compiled = readfile(opened) hashash = gethash(compiled) if hashash is not None and hashash == self.comp.genhash(package, code): return compiled return None
def has_hash_of(self, destpath, code, package_level): """Determine if a file has the hash of the code.""" if destpath is not None and os.path.isfile(destpath): with univ_open(destpath, "r") as opened: compiled = readfile(opened) hashash = gethash(compiled) if hashash is not None and hashash == self.comp.genhash(code, package_level): return True return False