11 import json |
11 import json |
12 import os |
12 import os |
13 import struct |
13 import struct |
14 import sys |
14 import sys |
15 from zlib import adler32 |
15 from zlib import adler32 |
|
16 import contextlib |
16 |
17 |
17 from PyQt5.QtCore import QProcess, pyqtSignal, QTimer |
18 from PyQt5.QtCore import QProcess, pyqtSignal, QTimer |
18 from PyQt5.QtWidgets import QApplication |
19 from PyQt5.QtWidgets import QApplication |
19 from PyQt5.QtNetwork import QTcpServer, QHostAddress |
20 from PyQt5.QtNetwork import QTcpServer, QHostAddress |
20 |
21 |
213 |
214 |
214 if res == E5MessageBox.Retry: |
215 if res == E5MessageBox.Retry: |
215 self.enqueueRequest(*self.runningJob) |
216 self.enqueueRequest(*self.runningJob) |
216 else: |
217 else: |
217 fx, lng, fn, data = self.runningJob |
218 fx, lng, fn, data = self.runningJob |
218 try: |
219 with contextlib.suppress(KeyError, TypeError): |
219 self.services[(fx, lng)][3](fx, lng, fn, self.tr( |
220 self.services[(fx, lng)][3](fx, lng, fn, self.tr( |
220 "An error in Eric's background client stopped the" |
221 "An error in Eric's background client stopped the" |
221 " service.") |
222 " service.") |
222 ) |
223 ) |
223 except (KeyError, TypeError): |
|
224 # ignore silently |
|
225 pass |
|
226 if res != E5MessageBox.No: |
224 if res != E5MessageBox.No: |
227 self.isWorking = None |
225 self.isWorking = None |
228 self.restartService(lang, True) |
226 self.restartService(lang, True) |
229 return |
227 return |
230 elif data == 'Unknown service.': |
228 elif data == 'Unknown service.': |