Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
blackboxo committed Feb 29, 2020
1 parent a242f5b commit ec97d04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
33 changes: 13 additions & 20 deletions autoui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"))
Expand Down
4 changes: 2 additions & 2 deletions loadPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down

0 comments on commit ec97d04

Please sign in to comment.