uos.remove(tmpfile_path)
ret = fota.download(srcurl,targetpyname)
if ret == 0 :
- print("ota success")
ql_fs.file_copy(targetfile_path, tmpfile_path)
set_version_to_json_config(app_type,version)
- # fota.set_update_flag() # 设置升级标志
- Power.powerRestart() # 重启
- else:
- print("ota failed")
+ print("ota success")
+ else:
+ print("ota failed")
+ # 升级后重启
+ Power.powerRestart()
else:
print("No need update python application")