14 pyqtSlot, QProcess, QProcessEnvironment, QCoreApplication, QEventLoop, |
14 pyqtSlot, QProcess, QProcessEnvironment, QCoreApplication, QEventLoop, |
15 QTimer |
15 QTimer |
16 ) |
16 ) |
17 from PyQt6.QtNetwork import QTcpServer, QHostAddress |
17 from PyQt6.QtNetwork import QTcpServer, QHostAddress |
18 |
18 |
19 from E5Gui import E5MessageBox |
19 from E5Gui import EricMessageBox |
20 |
20 |
21 import Preferences |
21 import Preferences |
22 import Utilities |
22 import Utilities |
23 |
23 |
24 |
24 |
150 #- this is for debugging only |
150 #- this is for debugging only |
151 |
151 |
152 try: |
152 try: |
153 clientDict = json.loads(jsonLine.strip()) |
153 clientDict = json.loads(jsonLine.strip()) |
154 except (TypeError, ValueError) as err: |
154 except (TypeError, ValueError) as err: |
155 E5MessageBox.critical( |
155 EricMessageBox.critical( |
156 None, |
156 None, |
157 self.tr("JSON Protocol Error"), |
157 self.tr("JSON Protocol Error"), |
158 self.tr("""<p>The response received from the client""" |
158 self.tr("""<p>The response received from the client""" |
159 """ could not be decoded. Please report""" |
159 """ could not be decoded. Please report""" |
160 """ this issue with the received data to the""" |
160 """ this issue with the received data to the""" |
161 """ eric bugs email address.</p>""" |
161 """ eric bugs email address.</p>""" |
162 """<p>Error: {0}</p>""" |
162 """<p>Error: {0}</p>""" |
163 """<p>Data:<br/>{1}</p>""").format( |
163 """<p>Data:<br/>{1}</p>""").format( |
164 str(err), Utilities.html_encode(jsonLine.strip())), |
164 str(err), Utilities.html_encode(jsonLine.strip())), |
165 E5MessageBox.Ok) |
165 EricMessageBox.Ok) |
166 return |
166 return |
167 |
167 |
168 self.handleCall(clientDict["method"], clientDict["params"]) |
168 self.handleCall(clientDict["method"], clientDict["params"]) |
169 |
169 |
170 def sendJson(self, command, params, flush=False, idString=""): |
170 def sendJson(self, command, params, flush=False, idString=""): |