예제 #1
0
파일: staging.py 프로젝트: 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
예제 #2
0
파일: compile.py 프로젝트: rajahaidar/lmctl
 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)
예제 #3
0
파일: pull.py 프로젝트: rajahaidar/lmctl
 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)
예제 #4
0
파일: staging.py 프로젝트: 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