--- a/src/eric7/RemoteServer/EricServerCoverageRequestHandler.py Mon Jun 10 11:41:34 2024 +0200 +++ b/src/eric7/RemoteServer/EricServerCoverageRequestHandler.py Mon Jun 10 15:42:05 2024 +0200 @@ -13,9 +13,10 @@ from eric7.SystemUtilities import FileSystemUtilities from .EricRequestCategory import EricRequestCategory +from .EricServerBaseRequestHandler import EricServerBaseRequestHandler -class EricServerCoverageRequestHandler: +class EricServerCoverageRequestHandler(EricServerBaseRequestHandler): """ Class implementing the code coverage request handler of the eric-ide server. """ @@ -27,9 +28,11 @@ @param server reference to the eric-ide server object @type EricServer """ - self.__server = server + super().__init__(server) - self.__requestMethodMapping = { + self._category = EricRequestCategory.Coverage + + self._requestMethodMapping = { "LoadData": self.__loadCoverageData, "AnalyzeFile": self.__analyzeFile, "AnalyzeFiles": self.__analyzeFiles, @@ -38,32 +41,9 @@ self.__cover = None - def handleRequest(self, request, params, reqestUuid): - """ - Public method handling the received file system requests. - - @param request request name - @type str - @param params dictionary containing the request parameters - @type dict - @param reqestUuid UUID of the associated request as sent by the eric IDE - @type str - """ - try: - result = self.__requestMethodMapping[request](params) - self.__server.sendJson( - category=EricRequestCategory.Coverage, - reply=request, - params=result, - reqestUuid=reqestUuid, - ) - - except KeyError: - self.__server.sendJson( - category=EricRequestCategory.Coverage, - reply=request, - params={"Error": f"Request type '{request}' is not supported."}, - ) + ############################################################################ + ## Coverage related methods below + ############################################################################ def __loadCoverageData(self, params): """