调用upload工具上传服务器

This commit is contained in:
ranchuan
2023-09-15 10:19:24 +08:00
parent 488d981c80
commit 51ece5388b
3 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ python/build/
python/dist/ python/dist/
*.xlsx *.xlsx
*.json *.json
quest_info.txt

View File

@@ -6,7 +6,7 @@
#define BUILD_DATE "2023-09-11 17:34:56" #define BUILD_DATE "2023-09-15 10:16:52"
#define SOFT_VERSION "0.11" #define SOFT_VERSION "0.11"

View File

@@ -2,7 +2,7 @@ import shutil
import sys import sys
import os import os
import prebuild as time import prebuild as time
import mysql # import mysql
# 定义app和boot文件路径(没有尾缀) # 定义app和boot文件路径(没有尾缀)
@@ -144,9 +144,12 @@ def main():
with open(dst,"wb") as f: with open(dst,"wb") as f:
f.write(data) f.write(data)
print(dst+' create app file success.') print(dst+' create app file success.')
sql=mysql.sql() readback=os.popen("upload "+SQL_APP_SAVE_PATH+" "+dst).readlines()
if(sql.init(SQL_APP_SAVE_PATH)==True): for i in readback:
sql.insert(dst) print(i)
# sql=mysql.sql()
# if(sql.init(SQL_APP_SAVE_PATH)==True):
# sql.insert(dst)
boot=BOOT_FILE_SRC+".bin" boot=BOOT_FILE_SRC+".bin"
boot_dst=BOOT_FILE_DST+"_"+date+".bin" boot_dst=BOOT_FILE_DST+"_"+date+".bin"
if os.path.exists(boot): if os.path.exists(boot):
@@ -161,9 +164,9 @@ def main():
with open(boot_dst,"wb") as f: with open(boot_dst,"wb") as f:
f.write(d) f.write(d)
print(boot_dst+" create boot file success.") print(boot_dst+" create boot file success.")
sql=mysql.sql() # sql=mysql.sql()
if(sql.init(SQL_BOOT_SAVE_PATH)==True): # if(sql.init(SQL_BOOT_SAVE_PATH)==True):
sql.insert(boot_dst) # sql.insert(boot_dst)
else: else:
print("please build bootloader to create boot file") print("please build bootloader to create boot file")
if __name__=="__main__": if __name__=="__main__":