Exemple #1
0
 def invoke_template(self, effect: token.TemplateEffect) -> None:
     source_path = self.source_path(effect)
     target_path = self.target_path(effect)
     source_text = SUDO.file_load(source_path)
     template = jinja2.Template(source_text)
     target_text = template.render(effect.context)
     SUDO.files_sync_base(source_path, target_path)  # copy attr
     SUDO.file_save(target_path, target_text)  # change content
     SUDO.files_sync_time(source_path, target_path)  # copy time
Exemple #2
0
 def invoke_copy(self, effect: token.CopyEffect) -> None:
     source_path = self.source_path(effect)
     target_path = self.target_path(effect)
     SUDO.files_sync_base(source_path, target_path)