From 356aa6dfdf25c78cb45fda00c9a4075720f623f4 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 3 May 2021 10:38:06 +0800 Subject: [PATCH] 1.2.31 fix minor test bug --- docs/meshtastic/test.html | 6 ++++-- docs/meshtastic/util.html | 8 +++++--- meshtastic/test.py | 3 ++- meshtastic/util.py | 3 ++- setup.py | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/meshtastic/test.html b/docs/meshtastic/test.html index 7d1f08a..ce9a9c1 100644 --- a/docs/meshtastic/test.html +++ b/docs/meshtastic/test.html @@ -59,7 +59,8 @@ def onReceive(packet, interface): if p.decoded.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets - receivedPackets.append(p) + if receivedPackets != None: + receivedPackets.append(p) def onNode(node): @@ -271,7 +272,8 @@ def testSimulator(): if p.decoded.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets - receivedPackets.append(p) + if receivedPackets != None: + receivedPackets.append(p)
diff --git a/docs/meshtastic/util.html b/docs/meshtastic/util.html index 40235ad..fcf689c 100644 --- a/docs/meshtastic/util.html +++ b/docs/meshtastic/util.html @@ -27,7 +27,7 @@ Expand source code
from collections import defaultdict
-import serial
+import serial, traceback
 import serial.tools.list_ports
 from queue import Queue
 import threading, sys, time, logging
@@ -113,7 +113,8 @@ class DeferredExecution():
                 o()
             except:
                 logging.error(
-                    f"Unexpected error in deferred execution {sys.exc_info()[0]}")
+ f"Unexpected error in deferred execution {sys.exc_info()[0]}") + print(traceback.format_exc())
@@ -226,7 +227,8 @@ class DeferredExecution(): o() except: logging.error( - f"Unexpected error in deferred execution {sys.exc_info()[0]}") + f"Unexpected error in deferred execution {sys.exc_info()[0]}") + print(traceback.format_exc())

Methods

diff --git a/meshtastic/test.py b/meshtastic/test.py index 2a0c662..28d6ed4 100644 --- a/meshtastic/test.py +++ b/meshtastic/test.py @@ -31,7 +31,8 @@ def onReceive(packet, interface): if p.decoded.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets - receivedPackets.append(p) + if receivedPackets != None: + receivedPackets.append(p) def onNode(node): diff --git a/meshtastic/util.py b/meshtastic/util.py index 1ad43b1..4f27d30 100644 --- a/meshtastic/util.py +++ b/meshtastic/util.py @@ -1,6 +1,6 @@ from collections import defaultdict -import serial +import serial, traceback import serial.tools.list_ports from queue import Queue import threading, sys, time, logging @@ -87,3 +87,4 @@ class DeferredExecution(): except: logging.error( f"Unexpected error in deferred execution {sys.exc_info()[0]}") + print(traceback.format_exc()) diff --git a/setup.py b/setup.py index f1110a8..b5ec913 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open("README.md", "r") as fh: # This call to setup() does all the work setup( name="meshtastic", - version="1.2.30", + version="1.2.31", description="Python API & client shell for talking to Meshtastic devices", long_description=long_description, long_description_content_type="text/markdown",