From d982088c7be97cfa843240b0d10b361e94152cf2 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Tue, 29 May 2018 17:59:20 +0100 Subject: [WS] "send all" methods should be classmethods --- pysite/websockets.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pysite') diff --git a/pysite/websockets.py b/pysite/websockets.py index ff8f0a12..213daace 100644 --- a/pysite/websockets.py +++ b/pysite/websockets.py @@ -71,12 +71,14 @@ class WS: def send_json(self, data): return self.send(json.dumps(data)) - def send_all(self, message, binary=None): - for connection in self._connections: + @classmethod + def send_all(cls, message, binary=None): + for connection in cls._connections: connection.send(message, binary=binary) - def send_all_json(self, data): - for connection in self._connections: + @classmethod + def send_all_json(cls, data): + for connection in cls._connections: connection.send_json(data) @classmethod -- cgit v1.2.3