kopia lustrzana https://github.com/Yakifo/amqtt
![]() - re.escape() the whole filter string first to escape _all_ regex metacharacters in it, not just $. (# and + are both regex metacharacters, so their replace expressions now need a leading \\ to replace the escaping, too.) - # matches topics both with and without a trailing /, so the replace expressions adds a '?' before the '.*'. The .lstrip('?') at the end removes this in case the # was the first character in the filter. - + should only match a single level, but it should _also_ match empty levels, so use '[^/]*' to replace it. - Use Regex.fullmatch() to match against the whole topic string, not just its start. Also add two unit tests to test this matching, and fix an incorrect match against + in test_client_subscribe_publish_dollar_topic_2. |
||
---|---|---|
.. | ||
mqtt | ||
plugins | ||
__init__.py | ||
conftest.py | ||
test_broker.py | ||
test_client.py | ||
test_codecs.py |