From 319b071fd8fe9bbd2e8398358722fe5f3862ec2b Mon Sep 17 00:00:00 2001 From: Daniel Ehlers Date: Thu, 30 Jan 2014 22:21:15 +0100 Subject: [PATCH] alfred: Make the alfred based batadv-vis data source optional. --- bat2nodes.py | 4 ++-- batman.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bat2nodes.py b/bat2nodes.py index 783e53f..15e0a39 100755 --- a/bat2nodes.py +++ b/bat2nodes.py @@ -47,12 +47,12 @@ db = NodeDB() if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) - db.parse_vis_data(bm.vis_data()) + db.parse_vis_data(bm.vis_data(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateways(gw.mac) else: bm = batman() - db.parse_vis_data(bm.vis_data()) + db.parse_vis_data(bm.vis_data(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) diff --git a/batman.py b/batman.py index c33f3e0..fac2a9e 100755 --- a/batman.py +++ b/batman.py @@ -9,8 +9,11 @@ class batman: def __init__(self, mesh_interface = "bat0"): self.mesh_interface = mesh_interface - def vis_data(self): - return self.vis_data_batadv_vis() + self.vis_data_batctl_legacy() + def vis_data(self,batadv_vis=False): + vds = self.vis_data_batctl_legacy() + if batadv_vis: + vds += self.vis_data_batadv_vis() + return vds def vis_data_helper(self,lines): vd = []