Ejemplo n.º 1
0
Archivo: staging.py Proyecto: IBM/lmctl
 def stage_file(self, orig_path, relative_staging_path, mutator=None):
     target_path = self._make_path(self.staging_path, relative_staging_path)
     if mutator is None:
         files.copy_file(orig_path, target_path)
     else:
         with open(orig_path, 'r') as file:
             old_contents = file.read()
         new_contents = mutator.apply(old_contents)
         with open(target_path, 'w') as file:
             file.write(new_contents)
     return target_path
Ejemplo n.º 2
0
 def compile_file(self, orig_path, relative_compile_path):
     target_path = self._make_path(self.compile_path, relative_compile_path)
     files.copy_file(orig_path, target_path)
Ejemplo n.º 3
0
 def backup_file(self, orig_path, relative_backup_path):
     target_path = self._make_path(self.backup_path, relative_backup_path)
     files.copy_file(orig_path, target_path)
Ejemplo n.º 4
0
Archivo: staging.py Proyecto: IBM/lmctl
 def copy_staged_file(self, orig_path, relative_staging_path):
     src_path = self._make_path(self.staging_path, orig_path)
     target_path = self._make_path(self.staging_path, relative_staging_path)
     files.copy_file(src_path, target_path)
     return target_path