Update web_tables.py

Fix problem with use BRIDGES_INC from config.py
This commit is contained in:
Waldek 2019-06-18 13:56:21 +02:00 committed by GitHub
parent b878515f65
commit a35bcc3c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -361,10 +361,10 @@ def build_stats():
global build_time global build_time
now = time() now = time()
if True: #now > build_time + 1: if True: #now > build_time + 1:
if CONFIG and CONFIG_INC: if CONFIG:
table = 'd' + dtemplate.render(_table=CTABLE) table = 'd' + dtemplate.render(_table=CTABLE)
dashboard_server.broadcast(table) dashboard_server.broadcast(table)
if BRIDGES and BRIDGES_INC: if BRIDGES:
table = 'b' + btemplate.render(_table=BTABLE['BRIDGES']) table = 'b' + btemplate.render(_table=BTABLE['BRIDGES'])
dashboard_server.broadcast(table) dashboard_server.broadcast(table)
build_time = now build_time = now
@ -480,7 +480,8 @@ def process_message(_message):
logging.debug('got BRIDGE_SND opcode') logging.debug('got BRIDGE_SND opcode')
BRIDGES = load_dictionary(_message) BRIDGES = load_dictionary(_message)
BRIDGES_RX = strftime('%Y-%m-%d %H:%M:%S', localtime(time())) BRIDGES_RX = strftime('%Y-%m-%d %H:%M:%S', localtime(time()))
BTABLE['BRIDGES'] = build_bridge_table(BRIDGES) if BRIDGES_INC:
BTABLE['BRIDGES'] = build_bridge_table(BRIDGES)
elif opcode == OPCODE['LINK_EVENT']: elif opcode == OPCODE['LINK_EVENT']:
logging.info('LINK_EVENT Received: {}'.format(repr(_message[1:]))) logging.info('LINK_EVENT Received: {}'.format(repr(_message[1:])))