From 40d7a33a026637c97f7b91c044381ae182629ad8 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Mon, 24 Feb 2020 23:52:20 +0100 Subject: [PATCH] fix some pep8 errors --- plugin/telegram.py | 4 ++-- pytest.sh | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 pytest.sh diff --git a/plugin/telegram.py b/plugin/telegram.py index 80ff9e7..5dea41f 100644 --- a/plugin/telegram.py +++ b/plugin/telegram.py @@ -45,13 +45,13 @@ class BoswatchPlugin(PluginBase): if bwPacket.get("lat") is not None and bwPacket.get("lon") is not None: logging.debug("Found coordinates in packet") (lat, lon) = (bwPacket.get("lat"), bwPacket.get("lon")) - + for chatId in self.config.get("chatIds", default=[]): try: # Send Message via Telegram logging.info("Sending message to " + chatId) self.bot.send_message(chat_id=chatId, text=msg) - + # Send Location via Telegram if lat and lon are defined if lat is not None and lon is not None: logging.info("Sending location to " + chatId) diff --git a/pytest.sh b/pytest.sh new file mode 100644 index 0000000..2a06d75 --- /dev/null +++ b/pytest.sh @@ -0,0 +1,3 @@ +source ./venv/bin/activate +pytest -c test/pytest.ini +deactivate \ No newline at end of file