mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-08 09:53:02 +02:00
Update system.py
This commit is contained in:
+16
-16
@@ -327,22 +327,6 @@ def exit_handler():
|
||||
asyncLoop.close()
|
||||
exit (0)
|
||||
|
||||
# this is a workaround because .localNode.getMetadata spits out a lot of debug info which cant be suppressed
|
||||
|
||||
from contextlib import contextmanager
|
||||
import os
|
||||
import sys
|
||||
|
||||
@contextmanager
|
||||
def suppress_stdout():
|
||||
with open(os.devnull, "w") as devnull:
|
||||
old_stdout = sys.stdout
|
||||
sys.stdout = devnull
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
sys.stdout = old_stdout
|
||||
|
||||
async def retry_interface(nodeID=1):
|
||||
global interface1, interface2
|
||||
# retry the interface
|
||||
@@ -365,6 +349,22 @@ async def retry_interface(nodeID=1):
|
||||
interface2 = meshtastic.ble_interface.BLEInterface(mac2)
|
||||
print(f"{log_timestamp()} System: Interface2 Opened")
|
||||
|
||||
# this is a workaround because .localNode.getMetadata spits out a lot of debug info which cant be suppressed
|
||||
|
||||
from contextlib import contextmanager
|
||||
import os
|
||||
import sys
|
||||
|
||||
@contextmanager
|
||||
def suppress_stdout():
|
||||
with open(os.devnull, "w") as devnull:
|
||||
old_stdout = sys.stdout
|
||||
sys.stdout = devnull
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
sys.stdout = old_stdout
|
||||
|
||||
async def watchdog():
|
||||
# watchdog for connection to the interface
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user