diff options
author | 2018-05-29 17:59:20 +0100 | |
---|---|---|
committer | 2018-05-29 17:59:20 +0100 | |
commit | d982088c7be97cfa843240b0d10b361e94152cf2 (patch) | |
tree | c9b54ec70e22f89b92534879ea85eedf17de0fb8 /pysite | |
parent | WS objects now keep track of their connections (diff) |
[WS] "send all" methods should be classmethods
Diffstat (limited to 'pysite')
-rw-r--r-- | pysite/websockets.py | 10 |
1 files changed, 6 insertions, 4 deletions
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 |