예제 #1
0
 def is_index_empty(self):
     """
     Returns `True` if index directory is empty and
     `False` otherwise
     """
     if len(ls_dir([self.index_path])):
         return False
     return True
예제 #2
0
파일: aim_repo.py 프로젝트: roubkar/aim
    def archive_dir(zip_path, dir_path):
        zip_file = zipfile.ZipFile(zip_path, 'w')
        with zip_file:
            # Writing each file one by one
            for file in ls_dir([dir_path]):
                zip_file.write(file, file[len(dir_path):])

        # Remove model directory
        shutil.rmtree(dir_path)
예제 #3
0
 def ls_commit_files(self, branch, commit):
     """
     Returns list of files of the specified commit
     """
     commit_path = os.path.join(self.path, branch, commit)
     return ls_dir([commit_path])
예제 #4
0
 def ls_branch_files(self, branch):
     """
     Returns list of files of the specified branch
     """
     branch_path = os.path.join(self.path, branch)
     return ls_dir([branch_path])
예제 #5
0
 def ls_files(self):
     """
     Returns list of repository files
     """
     return ls_dir([self.path])