From ec97d0462359cbae4f7b0d762f5cb3fc52bea17f Mon Sep 17 00:00:00 2001 From: blackboxo <592276898@qq.com> Date: Sat, 29 Feb 2020 22:23:37 +0800 Subject: [PATCH] fix error --- autoui.py | 33 +++++++++++++-------------------- loadPath.py | 4 ++-- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/autoui.py b/autoui.py index b14c9fd..038c933 100644 --- a/autoui.py +++ b/autoui.py @@ -177,6 +177,12 @@ def setupUi(self, MainWin): def confirm(self): self.fileList = [] self.dirList = [] + if self.lineEdit_2.text() == '': + QMessageBox.critical( + self, #使用infomation信息框 + "缺少天数", + "请输入需要删除多久以前的文件") + return if self.pushButton.isEnabled(): self.day = int(self.lineEdit_2.text()) self.picCacheCheck = self.checkBox.isChecked() @@ -229,29 +235,16 @@ def confirm(self): "清理完成", out) return - for value in self.version: - self.path = value - self.onButtonClick() - - elif self.lineEdit_2.text() == '': - QMessageBox.critical( - self, #使用infomation信息框 - "缺少月份", - "请输入需要删除多久以前的文件") - else: - QMessageBox.critical( - self, #使用infomation信息框 - "缺失路径", - "请输入微信文件的存储路径") + self.onButtonClick() def retranslateUi(self, MainWin): _translate = QtCore.QCoreApplication.translate - MainWin.setWindowTitle(_translate("MainWin", "微信客户端数据自动删除工具V1.1")) - icon = QtGui.QIcon() - # change to your own icon path - icon.addPixmap( - QtGui.QPixmap("C:\Project\AutoDeleteFileOnPCWechat\icon.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - MainWin.setWindowIcon(icon) + MainWin.setWindowTitle(_translate("MainWin", "微信客户端数据自动删除工具V1.2")) + # icon = QtGui.QIcon() + # # change to your own icon path + # icon.addPixmap( + # QtGui.QPixmap("C:\Project\AutoDeleteFileOnPCWechat\icon.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + # MainWin.setWindowIcon(icon) self.checkBox_4.setText(_translate("MainWin", "视频(视频文件和视频的封面图)")) self.label.setText(_translate("MainWin", "工具会自动识别路径,若自定义存储路径请填写:")) self.lineEdit_2.setText(_translate("MainWin", "365")) diff --git a/loadPath.py b/loadPath.py index 9ad1018..d4b0719 100644 --- a/loadPath.py +++ b/loadPath.py @@ -6,7 +6,7 @@ class loadPath(): def load(self): - syspath = sys.path[0] + syspath = sys.prefix correct_syspath = Path(syspath) filepath = correct_syspath / 'path_file.txt' if os.path.exists(filepath): @@ -17,7 +17,7 @@ def load(self): return '' def storage(self, path): - syspath = sys.path[0] + syspath = sys.prefix correct_syspath = Path(syspath) filepath = correct_syspath / 'path_file.txt' with open(filepath, 'w') as f: