Merge remote-tracking branch 'root/master' into dev1.2

This commit is contained in:
Kevin Hester
2021-03-27 11:06:29 +08:00
3 changed files with 6 additions and 14 deletions

View File

@@ -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"""