File tree 1 file changed +21
-5
lines changed
1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -362,13 +362,19 @@ def __init__(self, parent=None):
362
362
self .run_flash ()
363
363
364
364
def RunSpaceSniffer (self ):
365
- exe_path = "WCMain/SpaceSniffer.exe"
366
- process = subprocess .Popen ([exe_path ])
365
+ try :
366
+ exe_path = "WCMain/SpaceSniffer.exe"
367
+ subprocess .Popen ([exe_path ])
368
+ except Exception as e :
369
+ self .RunAPIError_bar ()
367
370
368
- def RunAppDataCleaner (self ):
369
- exe_path = "WCMain/AppDataCleaner.exe"
370
- process = subprocess .Popen ([exe_path ])
371
371
372
+ def RunAppDataCleaner (self ):
373
+ try :
374
+ exe_path = "WCMain/AppDataCleaner.exe"
375
+ subprocess .Popen ([exe_path ])
376
+ except Exception as e :
377
+ self .RunAPIError_bar ()
372
378
def on_operation_completed (self ):
373
379
self .info_bar ()
374
380
print ("完成" )
@@ -534,6 +540,16 @@ def PermissionError_bar(self):
534
540
parent = self ,
535
541
)
536
542
543
+ def RunAPIError_bar (self ):
544
+ InfoBar .warning (
545
+ title = "出错了!😭" ,
546
+ content = "未知错误,请联系开发者" ,
547
+ orient = Qt .Horizontal ,
548
+ isClosable = True ,
549
+ position = InfoBarPosition .TOP ,
550
+ duration = 5000 ,
551
+ parent = self ,
552
+ )
537
553
538
554
if __name__ == "__main__" :
539
555
logger .error ("请运行 main.py ,而不是 clean.py" )
You can’t perform that action at this time.
0 commit comments