kopia lustrzana https://github.com/Yakifo/amqtt
cleaning up incorrect resolutions of merge conflicts
rodzic
3cddea336e
commit
15e0e9a24e
|
@ -1,4 +1,4 @@
|
||||||
\# Contributing to aMQTT
|
# Contributing to aMQTT
|
||||||
|
|
||||||
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from functools import partial
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
from typing import Any, ClassVar, TypeAlias
|
from typing import Any, ClassVar
|
||||||
|
|
||||||
from transitions import Machine, MachineError
|
from transitions import Machine, MachineError
|
||||||
import websockets.asyncio.server
|
import websockets.asyncio.server
|
||||||
|
@ -825,20 +825,6 @@ class Broker:
|
||||||
self.logger.debug(f"Unsubscription on topic '{a_filter}' for client {format_client_message(session=session)}")
|
self.logger.debug(f"Unsubscription on topic '{a_filter}' for client {format_client_message(session=session)}")
|
||||||
return deleted
|
return deleted
|
||||||
|
|
||||||
def matches(self, topic, a_filter):
|
|
||||||
if "#" not in a_filter and "+" not in a_filter:
|
|
||||||
# if filter doesn't contain wildcard, return exact match
|
|
||||||
return a_filter == topic
|
|
||||||
else:
|
|
||||||
# else use regex
|
|
||||||
match_pattern = re.compile(
|
|
||||||
re.escape(a_filter)
|
|
||||||
.replace("\\#", "?.*")
|
|
||||||
.replace("\\+", "[^/]*")
|
|
||||||
.lstrip("?")
|
|
||||||
)
|
|
||||||
return match_pattern.fullmatch(topic)
|
|
||||||
|
|
||||||
async def _broadcast_loop(self) -> None:
|
async def _broadcast_loop(self) -> None:
|
||||||
"""Run the main loop to broadcast messages."""
|
"""Run the main loop to broadcast messages."""
|
||||||
running_tasks: deque[asyncio.Task[OutgoingApplicationMessage]] = self._tasks_queue
|
running_tasks: deque[asyncio.Task[OutgoingApplicationMessage]] = self._tasks_queue
|
||||||
|
|
Ładowanie…
Reference in New Issue