1、修复了只读权限下保存csv时,无法正确保存的问题,当无法正确保存时,程序将输出较为直观的提示信息

2、对多处保存路径进行了空值检测,为空值时程序将输出较为直观的提示信息
This commit is contained in:
2025-06-04 00:29:18 +08:00
parent ba2de0df39
commit 65f8bef694
14 changed files with 193 additions and 33 deletions

View File

@ -970,6 +970,10 @@ class Data:
# 保存到csv中
df = DataFrame({"pos": [pos], "epoch": [epoch], "ApplyFrequency": [ApplyFrequency]})
df.to_csv(Path(Config["Path"]["Save"]), mode="w", header=True, index=False)
except PermissionError as e:
return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_Permission_Denied"])
except FileNotFoundError as e:
return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_File_Not_Found"])
except Exception as e:
return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON[
"Save_Exception"] + "\n" + format_exc())