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 +``` diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 741a378..85d7ecd 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -17,7 +17,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' @@ -139,14 +139,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: @@ -169,10 +163,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"] },