Compare commits

...

2 Commits

Author SHA1 Message Date
Hemna 185d40a06e Update for aprsd 2.7.0 2022-12-20 17:23:08 -05:00
Hemna 295e35aa06 remove trace 2022-12-20 17:23:08 -05:00
6 changed files with 35 additions and 8 deletions

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
Hemna <waboring@hemna.com>

18
ChangeLog Normal file
View File

@ -0,0 +1,18 @@
CHANGES
=======
v0.3.0
------
* Added PBR Version
v0.2.0
------
* Updated command to 'tw' from 't'. Added Help
* First working version that tweets!
v0.1.0
------
* Initial commit

View File

@ -21,7 +21,7 @@ docs: build
cp Changelog docs/changelog.rst
tox -edocs
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean: clean-build clean-pyc clean-test clean-dev ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
@ -42,6 +42,10 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/
rm -fr .pytest_cache
clean-dev:
rm -rf $(VENVDIR)
rm Makefile.venv
coverage: ## check code coverage quickly with the default Python
coverage run --source aprsd_twitter_plugin setup.py test
coverage report -m

View File

@ -1,7 +1,9 @@
import logging
import tweepy
from aprsd import messaging, plugin, trace
from aprsd import packets, plugin
import aprsd_twitter_plugin
LOG = logging.getLogger("APRSD")
@ -9,7 +11,7 @@ LOG = logging.getLogger("APRSD")
class SendTweetPlugin(plugin.APRSDRegexCommandPluginBase):
version = "1.0"
version = aprsd_twitter_plugin.__version__
# Look for any command that starts with tw or tW or TW or Tw
command_regex = "^[tT][wW]"
# the command is for ?
@ -72,15 +74,14 @@ class SendTweetPlugin(plugin.APRSDRegexCommandPluginBase):
return api
@trace.trace
def process(self, packet):
"""This is called when a received packet matches self.command_regex."""
LOG.info("SendTweetPlugin Plugin")
from_callsign = packet.get("from")
message = packet.get("message_text", None)
from_callsign = packet.from_call
message = packet.message_text
message = message.split(" ")
del message[0]
message = " ".join(message)
@ -104,4 +105,4 @@ class SendTweetPlugin(plugin.APRSDRegexCommandPluginBase):
return "Tweet sent!"
else:
LOG.warning("SendTweetPlugin is disabled.")
return messaging.NULL_MESSAGE
return packets.NULL_MESSAGE

View File

@ -1,3 +1,3 @@
pbr
aprsd>=2.2.0
aprsd>=2.7.0
tweepy

View File

@ -38,3 +38,6 @@ upload-dir = doc/build/html
[mypy]
ignore_missing_imports = True
strict = True
[bdist_wheel]
universal = 1