Beispiel #1
0
 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
Beispiel #2
0
 def template_file(self, path):
     return Template.from_file(path, self)