mirror of
https://github.com/craigerl/aprsd.git
synced 2025-09-02 13:17:54 -04:00
change query char from ? to !
This commit is contained in:
parent
658e6b6202
commit
7de2820caa
@ -11,7 +11,7 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
"""Query command."""
|
"""Query command."""
|
||||||
|
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
command_regex = r"^\?.*"
|
command_regex = r"^\!.*"
|
||||||
command_name = "query"
|
command_name = "query"
|
||||||
|
|
||||||
def command(self, fromcall, message, ack):
|
def command(self, fromcall, message, ack):
|
||||||
@ -28,8 +28,8 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
# only I can do admin commands
|
# only I can do admin commands
|
||||||
if re.search(searchstring, fromcall):
|
if re.search(searchstring, fromcall):
|
||||||
|
|
||||||
# resend last N most recent: "?3"
|
# resend last N most recent: "!3"
|
||||||
r = re.search(r"^\?([0-9]).*", message)
|
r = re.search(r"^\!([0-9]).*", message)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
if len(tracker) > 0:
|
if len(tracker) > 0:
|
||||||
last_n = r.group(1)
|
last_n = r.group(1)
|
||||||
@ -41,8 +41,8 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
LOG.debug(reply)
|
LOG.debug(reply)
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
# resend all: "?a"
|
# resend all: "!a"
|
||||||
r = re.search(r"^\?[aA].*", message)
|
r = re.search(r"^\![aA].*", message)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
if len(tracker) > 0:
|
if len(tracker) > 0:
|
||||||
reply = messaging.NULL_MESSAGE
|
reply = messaging.NULL_MESSAGE
|
||||||
@ -53,8 +53,8 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
LOG.debug(reply)
|
LOG.debug(reply)
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
# delete all: "?d"
|
# delete all: "!d"
|
||||||
r = re.search(r"^\?[dD].*", message)
|
r = re.search(r"^\![dD].*", message)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
reply = "Deleted ALL pending msgs."
|
reply = "Deleted ALL pending msgs."
|
||||||
LOG.debug(reply)
|
LOG.debug(reply)
|
||||||
|
@ -41,7 +41,7 @@ class TestPlugin(unittest.TestCase):
|
|||||||
|
|
||||||
@mock.patch("aprsd.messaging.MsgTrack.flush")
|
@mock.patch("aprsd.messaging.MsgTrack.flush")
|
||||||
def test_query_flush(self, mock_flush):
|
def test_query_flush(self, mock_flush):
|
||||||
message = "?delete"
|
message = "!delete"
|
||||||
query = query_plugin.QueryPlugin(self.config)
|
query = query_plugin.QueryPlugin(self.config)
|
||||||
|
|
||||||
expected = "Deleted ALL pending msgs."
|
expected = "Deleted ALL pending msgs."
|
||||||
@ -53,7 +53,7 @@ class TestPlugin(unittest.TestCase):
|
|||||||
def test_query_restart_delayed(self, mock_restart):
|
def test_query_restart_delayed(self, mock_restart):
|
||||||
track = messaging.MsgTrack()
|
track = messaging.MsgTrack()
|
||||||
track.track = {}
|
track.track = {}
|
||||||
message = "?4"
|
message = "!4"
|
||||||
query = query_plugin.QueryPlugin(self.config)
|
query = query_plugin.QueryPlugin(self.config)
|
||||||
|
|
||||||
expected = "No pending msgs to resend"
|
expected = "No pending msgs to resend"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user