mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Override 'unsubscriptable-object' pylint rule
False positive from 'self' use
This commit is contained in:
parent
476025a370
commit
03a54d0249
@ -27,7 +27,7 @@ class WebSocketHelper:
|
||||
f"Sending to {len(self.clients)} clients: "
|
||||
f"{json.dumps({'event': event_type, 'data': data})}"
|
||||
)
|
||||
for client in self.clients[:]:
|
||||
for client in self.clients[:]: # pylint: disable=unsubscriptable-object
|
||||
try:
|
||||
self.send_message(client, event_type, data)
|
||||
except Exception as e:
|
||||
@ -36,6 +36,9 @@ class WebSocketHelper:
|
||||
f"{client.get_remote_ip()} {e}"
|
||||
)
|
||||
|
||||
# Excempting 'unsubscriptable-object' warning as false positive from 'self' use
|
||||
# Code has been tested by Andrew and functions as intended.
|
||||
|
||||
def broadcast_page(self, page: str, event_type: str, data):
|
||||
def filter_fn(client):
|
||||
return client.page == page
|
||||
|
Loading…
Reference in New Issue
Block a user