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
评论列表
文章目录