From b2d406f94185359d3a115efcd73f306d8d9eb991 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 24 Jul 2020 20:11:03 +0200 Subject: [PATCH] api: declare BaseAPI._message to be abstract Now that all API providers are converted to use the high level dispatcher, make the implementation of that mandatory by declaring it an abstract method. --- osbuild/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osbuild/api.py b/osbuild/api.py index 6020a418..e2a8b406 100644 --- a/osbuild/api.py +++ b/osbuild/api.py @@ -27,7 +27,7 @@ class BaseAPI(abc.ABC): when the context is left. New messages are delivered via the `_message` method, that - is meant to be implemented by deriving classes. + needs to be implemented by deriving classes. Optionally, the `_cleanup` method can be implemented, to clean up resources after the context is left and the @@ -50,6 +50,7 @@ class BaseAPI(abc.ABC): def endpoint(cls): """The name of the API endpoint""" + @abc.abstractmethod def _message(self, msg: Dict, fds: jsoncomm.FdSet, sock: jsoncomm.Socket, addr: str): """Called for a new incoming message"""