File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,11 @@ def openfile(self):
54
54
55
55
56
56
def double_click_search_table (self , info ):
57
- file_path = self .resultTable .item (info .row (), 0 ).text ()
58
- try :
57
+ file_path = os . path . normpath ( self .resultTable .item (info .row (), 0 ).text () )
58
+ if os . path . exists ( file_path ) :
59
59
os .startfile (file_path )
60
- except Exception :
61
- QtWidgets .QMessageBox .warning (self , '警告' , '打开文件失败 :' + file_path )
60
+ else :
61
+ QtWidgets .QMessageBox .warning (self , '警告' , '图片文件不存在 :' + file_path )
62
62
63
63
64
64
def double_click_duplicate_table (self , info ):
@@ -67,10 +67,10 @@ def double_click_duplicate_table(self, info):
67
67
return
68
68
row = info .row ()
69
69
file_path = self .resultTableDuplicate .item (row , col ).text ()
70
- try :
70
+ if os . path . exists ( file_path ) :
71
71
os .startfile (file_path )
72
- except Exception :
73
- QtWidgets .QMessageBox .warning (self , '警告' , '打开文件失败 :' + file_path )
72
+ else :
73
+ QtWidgets .QMessageBox .warning (self , '警告' , '图片文件不存在 :' + file_path )
74
74
75
75
76
76
def start_search (self ):
You can’t perform that action at this time.
0 commit comments