peer_score.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:loopchain 作者: theloopkr 项目源码 文件源码
def load_package_by_file(self):
        """
        ???? ??? ??

        :return:
        """
        # ?? ??? ?? ??
        # 1. repository_path ? ?? ???? zip??? ??? ??? ??? ??? ??, Git ????? ?? ??
        # 2. repository_path Remote Repository ?? pull ? ?? ? ??? pull? ??
        # 3. exception? ????, ???? ?? ???.
        # ????? ??? ?? ???? ???? ?? ???? ????? ????
        # ?????? ??? ?? ??
        # ?????? ????? ???? ?? ???? (?/..?) ? _ ? ????.

        score_package_file = get_valid_filename(self.__score_package)
        logging.debug(self.__repository_path)
        package_file = osp.join(self.__repository_path, score_package_file+".zip")
        logging.debug('load_package_by_file '+str(package_file))
        if osp.isfile(package_file):
            package_zip = zipfile.ZipFile(package_file, 'r')
            # file exists
            logging.debug("load local package file and package file exist")
            # ??? ??? ????? ??? ?? ???.
            # ??? ???? ??
            os.makedirs(self.__package_path, exist_ok=True)
            # ?? ?? ??

            package_zip.extractall(self.__package_path)
            package_zip.close()
            # ????? ??? ????? ?? ???.
            return self.load_package_by_local_repository()
        else:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号