From 5474dd7494525607be4d25dad855d62d98304f38 Mon Sep 17 00:00:00 2001 From: meehow Date: Tue, 23 Mar 2021 09:51:30 +0100 Subject: [PATCH 1/2] Update README.md closes #73 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 95e5bdf..f9e8e07 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ meshtastic --setlat 25.2 --setlon -16.8 --setalt 120 Or to configure an ESP32 based board to join a wifi network as a station (wifi support in the device code is coming soon): ``` -meshtastic --set wifi_ap_mode false --setstr wifi_ssid mywifissid --setstr wifi_password mywifipsw +meshtastic --set wifi_ap_mode false --set wifi_ssid mywifissid --set wifi_password mywifipsw ``` Or to configure an ESP32 to run as a Wifi access point: ``` -meshtastic --set wifi_ap_mode true --setstr wifi_ssid mywifissid --setstr wifi_password mywifipsw +meshtastic --set wifi_ap_mode true --set wifi_ssid mywifissid --set wifi_password mywifipsw ``` For a full list of preferences which can be set (and their documentation) see [here](https://github.com/meshtastic/Meshtastic-protobufs/blob/master/docs/docs.md#.RadioConfig.UserPreferences). @@ -135,4 +135,4 @@ If you need to build a new release you'll need: ``` apt install pandoc sudo pip3 install markdown pandoc webencodings pyparsing twine autopep8 -``` \ No newline at end of file +``` From 65dc2c83d72c4f72bfff809a23bce0ae7b6b1564 Mon Sep 17 00:00:00 2001 From: Tim Gunter Date: Fri, 26 Mar 2021 08:56:42 -0700 Subject: [PATCH 2/2] Switch to using tabulate to print out node database --- meshtastic/__main__.py | 12 ++---------- setup.py | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index d74b470..4b4aee7 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -13,7 +13,7 @@ import traceback import pkg_resources from datetime import datetime import timeago -from easy_table import EasyTable +from tabulate import tabulate """We only import the tunnel code if we are on a platform that can run it""" have_tunnel = platform.system() == 'Linux' @@ -131,14 +131,8 @@ def getTimeAgo(ts, default="N/A"): # Print Nodes - def printNodes(nodes, myId): # Create the table and define the structure - table = EasyTable("Nodes") - table.setCorners("/", "\\", "\\", "/") - table.setOuterStructure("|", "-") - table.setInnerStructure("|", "-", "+") - tableData = [] for node in nodes: if node['user']['id'] == myId: @@ -161,10 +155,8 @@ def printNodes(nodes, myId): RowsOk = sorted(Rows, key=lambda k: k['LastHeard'].startswith("N/A")) for i in range(len(RowsOk)): RowsOk[i]['N'] = i+1 - table.setData(RowsOk) - - table.displayTable() + print(tabulate(RowsOk, headers='keys', tablefmt='fancy_grid')) def setPref(attributes, name, valStr): """Set a channel or preferences value""" diff --git a/setup.py b/setup.py index 218190d..a6844cc 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setup( include_package_data=True, install_requires=["pyserial>=3.4", "protobuf>=3.13.0", "pypubsub>=4.0.3", "dotmap>=1.3.14", "pexpect>=4.6.0", "pyqrcode>=1.2.1", - "pygatt>=4.0.5", "easy-table==0.0.4", "timeago>=1.0.15"], + "pygatt>=4.0.5", "tabulate>=0.8.9", "timeago>=1.0.15"], extras_require={ 'tunnel': ["pytap2>=2.0.0"] },