Forest_Client/Tool/Luban/auto.py

30 lines
824 B
Python

import download_util
import openpyxl
import os
import sys
if not download_util.download_single_file("AConfigList.xlsx", "e3_AQIA8QbmAKEFwoGRFPhT9uizRsOaA"):
download_util.write_file("./result", "error")
sys.exit()
if os.path.exists("./Datas/AConfigList.xlsx"):
wb = openpyxl.load_workbook("./Datas/AConfigList.xlsx")
sheet = wb.active
config_list = ""
for row in sheet.iter_rows():
if row[0].value is None:
break
if not download_util.download_single_file(row[0].value, row[1].value):
download_util.write_file("./result", "error")
break
else:
download_util.write_file("./result", "error")
print("./Datas/AConfigList.xlsx 不存在,未拉取线上最新配置")
download_util.write_file("./result", "ok")
print("任务执行完毕")