添加自动更新程序,测试版

This commit is contained in:
ngfchl
2022-12-06 06:11:21 +08:00
parent 9a0f517d72
commit 63103ea3f6
2 changed files with 88 additions and 1 deletions

View File

@@ -396,6 +396,7 @@ def update_page(request):
})
"""
def exec_command(commands):
result = []
for key, command in commands.items():
@@ -406,9 +407,14 @@ def exec_command(commands):
'res': p.returncode
})
return result
"""
def do_update(request):
return JsonResponse(data=pt_site.auto_upgrade().to_dict(), safe=False)
"""
try:
logger.info('开始更新')
pt_site_site_mtime = os.stat('pt_site_site.json').st_mtime
@@ -467,6 +473,7 @@ def do_update(request):
return JsonResponse(data=CommonResponse.error(
msg=msg
).to_dict(), safe=False)
"""
def do_xpath(request):