src/eric7/RemoteServerInterface/EricServerInterface.py

branch
server
changeset 10597
fbe93720ee9f
parent 10574
622e59b51640
child 10630
552a790fd9bc
equal deleted inserted replaced
10596:ea35c92a3c7c 10597:fbe93720ee9f
117 # instantiate the service interface 117 # instantiate the service interface
118 if lname == "filesystem": 118 if lname == "filesystem":
119 from .EricServerFileSystemInterface import ( # noqa: I101 119 from .EricServerFileSystemInterface import ( # noqa: I101
120 EricServerFileSystemInterface, 120 EricServerFileSystemInterface,
121 ) 121 )
122 self.__serviceInterfaces[lname] = ( 122
123 EricServerFileSystemInterface(self) 123 self.__serviceInterfaces[lname] = EricServerFileSystemInterface(
124 self
124 ) 125 )
125 elif lname == "debugger": 126 elif lname == "debugger":
126 from .EricServerDebuggerInterface import ( # noqa: I101 127 from .EricServerDebuggerInterface import ( # noqa: I101
127 EricServerDebuggerInterface, 128 EricServerDebuggerInterface,
128 ) 129 )
130
129 self.__serviceInterfaces[lname] = EricServerDebuggerInterface(self) 131 self.__serviceInterfaces[lname] = EricServerDebuggerInterface(self)
130 elif lname == "coverage": 132 elif lname == "coverage":
131 from .EricServerCoverageInterface import ( # noqa: I101 133 from .EricServerCoverageInterface import ( # noqa: I101
132 EricServerCoverageInterface, 134 EricServerCoverageInterface,
133 ) 135 )
136
134 self.__serviceInterfaces[lname] = EricServerCoverageInterface(self) 137 self.__serviceInterfaces[lname] = EricServerCoverageInterface(self)
135 elif lname == "project": 138 elif lname == "project":
136 # TODO: 'Project Interface' not implemented yet 139 # TODO: 'Project Interface' not implemented yet
137 pass 140 pass
138 141
181 host if ":" not in host else f"[{host}]", 184 host if ":" not in host else f"[{host}]",
182 port, 185 port,
183 self.__connection.errorString(), 186 self.__connection.errorString(),
184 ), 187 ),
185 ) 188 )
186 189
187 self.__connection = None 190 self.__connection = None
188 return False 191 return False
189 192
190 self.__connection.readyRead.connect(self.__receiveJson) 193 self.__connection.readyRead.connect(self.__receiveJson)
191 self.__connection.disconnected.connect(self.__handleDisconnect) 194 self.__connection.disconnected.connect(self.__handleDisconnect)
405 """ 408 """
406 if reply != "Versions": 409 if reply != "Versions":
407 raise ValueError(f"unsupported reply received ({reply})") 410 raise ValueError(f"unsupported reply received ({reply})")
408 411
409 else: 412 else:
410 hostname = params['hostname'] 413 hostname = params["hostname"]
411 versionText = self.tr( 414 versionText = self.tr("<h2>{0}Version Numbers</h2><table>").format(
412 "<h2>{0}Version Numbers</h2><table>" 415 self.tr("{0} - ").format(hostname) if hostname else ""
413 ).format(self.tr("{0} - ").format(hostname) if hostname else "") 416 )
414 417
415 # Python version 418 # Python version
416 versionText += ( 419 versionText += (
417 """<tr><td><b>Python</b></td><td>{0}, {1}</td></tr>""" 420 """<tr><td><b>Python</b></td><td>{0}, {1}</td></tr>"""
418 ).format(params["python"], params["py_bitsize"]) 421 ).format(params["python"], params["py_bitsize"])
419 422
443 @param params dictionary containing the specific reply data 446 @param params dictionary containing the specific reply data
444 @type dict 447 @type dict
445 """ 448 """
446 if reply == "ClientChecksumException": 449 if reply == "ClientChecksumException":
447 self.__ui.appendToStderr( 450 self.__ui.appendToStderr(
448 self.tr("eric-ide Server Checksum Error\nError: {0}\nData:\n{1}\n") 451 self.tr(
449 .format(params["ExceptionValue"], params["ProtocolData"]) 452 "eric-ide Server Checksum Error\nError: {0}\nData:\n{1}\n"
453 ).format(params["ExceptionValue"], params["ProtocolData"])
450 ) 454 )
451 455
452 elif reply == "ClientException": 456 elif reply == "ClientException":
453 self.__ui.appendToStderr( 457 self.__ui.appendToStderr(
454 self.tr("eric-ide Server Data Error\nError: {0}\nData:\n{1}\n") 458 self.tr("eric-ide Server Data Error\nError: {0}\nData:\n{1}\n").format(
455 .format(params["ExceptionValue"], params["ProtocolData"]) 459 params["ExceptionValue"], params["ProtocolData"]
460 )
456 ) 461 )
457 462
458 elif reply == "UnsupportedServiceCategory": 463 elif reply == "UnsupportedServiceCategory":
459 self.__ui.appendToStderr( 464 self.__ui.appendToStderr(
460 self.tr( 465 self.tr(

eric ide

mercurial