1、修复了只读权限下保存csv时,无法正确保存的问题,当无法正确保存时,程序将输出较为直观的提示信息
2、对多处保存路径进行了空值检测,为空值时程序将输出较为直观的提示信息
This commit is contained in:
@ -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())
|
||||
|
||||
Reference in New Issue
Block a user