def should_replace_using_template(self): """ for from_template , should we write the template? """ if not FileTests.exists(self.name): return True if not self.overwrite: return False self.evaluated_template = Template.from_file(self.from_template, self.resource) c1 = FileTests.string_checksum(self.evaluated_template) c2 = FileTests.checksum(self.name) return c1 != c2
def template_file(self, path): return Template.from_file(path, self)