Skip to content

Commit

Permalink
iterate over listeners[event] and run the callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNeil17 committed Jun 28, 2024
1 parent 7503301 commit 009f2f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def handle_message(self, message: str):
message = json.loads(message)
event = message["event"]

Check failure on line 28 in backend/ws.py

View workflow job for this annotation

GitHub Actions / Pyright (3.x)

Argument of type "Literal['event']" cannot be assigned to parameter "__key" of type "SupportsIndex | slice" in function "__getitem__"   Type "Literal['event']" cannot be assigned to type "SupportsIndex | slice"     "Literal['event']" is incompatible with protocol "SupportsIndex"       "__index__" is not present     "Literal['event']" is incompatible with "slice" (reportArgumentType)
args = message["args"]

Check failure on line 29 in backend/ws.py

View workflow job for this annotation

GitHub Actions / Pyright (3.x)

Argument of type "Literal['args']" cannot be assigned to parameter "__key" of type "SupportsIndex | slice" in function "__getitem__"   Type "Literal['args']" cannot be assigned to type "SupportsIndex | slice"     "Literal['args']" is incompatible with protocol "SupportsIndex"       "__index__" is not present     "Literal['args']" is incompatible with "slice" (reportArgumentType)
func = self.listeners.get(event)
if func: func(args)
for func in self.listeners.get(event): func(*args)

Check failure on line 30 in backend/ws.py

View workflow job for this annotation

GitHub Actions / Pyright (3.x)

Object of type "None" cannot be used as iterable value (reportOptionalIterable)

def connect(self):
with client.connect(self.uri) as ws:
Expand Down

0 comments on commit 009f2f7

Please sign in to comment.