mirror of
https://github.com/meshtastic/python.git
synced 2026-05-19 05:46:14 -04:00
Merge remote-tracking branch 'root/master' into dev1.2
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user