From a389273779579e655d0097bac85cb441c6aca24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 16 Dec 2018 19:16:01 +0100 Subject: [PATCH] Make handle_message() public --- echo_server.py | 2 +- pipe_io_server/pipe_io_server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/echo_server.py b/echo_server.py index faef8c6..b5c339c 100644 --- a/echo_server.py +++ b/echo_server.py @@ -4,7 +4,7 @@ from pipe_io_server import PipeIOServer class EchoPipeIOServer(PipeIOServer): - def _handle_message(self, message): + def handle_message(self, message): self.send(message) diff --git a/pipe_io_server/pipe_io_server.py b/pipe_io_server/pipe_io_server.py index 5568f49..f220513 100644 --- a/pipe_io_server/pipe_io_server.py +++ b/pipe_io_server/pipe_io_server.py @@ -39,14 +39,14 @@ class PipeIOServer(ABC): def _init_io_threads(self): io_threads_dict = { - 'reader': PipeReaderThread(self.in_pipe, self._handle_message), + 'reader': PipeReaderThread(self.in_pipe, self.handle_message), 'writer': PipeWriterThread(self.out_pipe) } IOThreadsTuple = namedtuple('IOThreadsTuple', sorted(io_threads_dict.keys())) self._io_threads = IOThreadsTuple(**io_threads_dict) @abstractmethod - def _handle_message(self, message): + def handle_message(self, message): raise NotImplementedError() def send(self, message):