parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files', required=True) args = parser.parse_args() options = vars(args) db = NodeDB() if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) 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(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases)))
parser.add_argument("-m", "--mesh", action="append", help="batman mesh interface") parser.add_argument("-o", "--obscure", action="store_true", help="obscure client macs") parser.add_argument("-A", "--alfred", action="store_true", help="retrieve aliases from alfred") parser.add_argument( "-d", "--destination-directory", action="store", help="destination directory for generated files", required=True ) args = parser.parse_args() options = vars(args) db = NodeDB() if options["mesh"]: for mesh_interface in options["mesh"]: bm = batman(mesh_interface) 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(options["alfred"])) for gw in bm.gateway_list(): db.mark_gateways([gw["mac"]]) if options["aliases"]: for aliases in options["aliases"]: db.import_aliases(json.load(open(aliases)))
help='batman mesh interface') parser.add_argument('-o', '--obscure', action='store_true', help='obscure client macs') parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files',required=True) args = parser.parse_args() options = vars(args) db = NodeDB(int(time.time())) if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) 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(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) if options['aliases']: for aliases in options['aliases']:
parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files', required=True) args = parser.parse_args() options = vars(args) db = NodeDB(int(time.time())) for mesh_interface in options['mesh']: bm = batman(mesh_interface) db.parse_vis_data(bm.vis_data(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateway(gw) if options['alfred']: af = alfred() db.import_aliases(af.aliases()) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases)))
parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files',required=True) parser.add_argument('-u', '--unix-path', action='store', default=["/var/run/alfred.sock"], help='path to unix socket used for alfred server communication') args = parser.parse_args() options = vars(args) db = NodeDB(int(time.time())) for mesh_interface in options['mesh']: bm = batman(mesh_interface) db.parse_vis_data(bm.vis_data(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateway(gw) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases))) if options['alfred']: af = alfred() db.import_aliases(af.aliases())
parser = argparse.ArgumentParser() parser.add_argument('-a', '--aliases', help='read aliases from FILE', metavar='FILE') parser.add_argument('-g', '--gateway', action='append', help='MAC of a gateway') parser.add_argument('batmanjson', help='output of batman vd json') args = parser.parse_args() options = vars(args) db = NodeDB() db.import_batman(list(fileinput.input(options['batmanjson']))) db.import_wikigps("http://freifunk.metameute.de/Knoten") if options['aliases']: db.import_aliases(json.load(open(options['aliases']))) if options['gateway']: db.mark_gateways(options['gateway']) m = D3MapBuilder(db) print(m.build())
parser = argparse.ArgumentParser() parser.add_argument('-a', '--aliases', help='read aliases from FILE', action='append', metavar='FILE') parser.add_argument('-g', '--gateway', action='append', help='MAC of a gateway') parser.add_argument('batmanjson', help='output of batman vd json') args = parser.parse_args() options = vars(args) db = NodeDB() db.import_batman(list(fileinput.input(options['batmanjson']))) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases))) if options['gateway']: db.mark_gateways(options['gateway']) m = D3MapBuilder(db) print(m.build())
help='batman mesh interface') parser.add_argument('-o', '--obscure', action='store_true', help='obscure client macs') parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files',required=True) args = parser.parse_args() options = vars(args) db = NodeDB() if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) 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(options['alfred'])) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases)))
parser.add_argument('-a', '--aliases', help='read aliases from FILE', action='append', metavar='FILE') parser.add_argument('-m', '--mesh', action='append', help='batman mesh interface') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files',required=True) args = parser.parse_args() options = vars(args) db = NodeDB() if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) db.parse_vis_data(bm.vis_data()) for gw in bm.gateway_list(): db.mark_gateways(gw.mac) else: bm = batman() db.parse_vis_data(bm.vis_data()) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) if options['aliases']: for aliases in options['aliases']: db.import_aliases(json.load(open(aliases)))
metavar='FILE') parser.add_argument('-m', '--mesh', action='append', help='batman mesh interface') parser.add_argument('-A', '--alfred', action='store_true', help='retrieve aliases from alfred') parser.add_argument('-d', '--destination-directory', action='store', help='destination directory for generated files',required=True) args = parser.parse_args() options = vars(args) db = NodeDB(int(time.time())) if options['mesh']: for mesh_interface in options['mesh']: bm = batman(mesh_interface) 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(batadv_vis=True)) for gw in bm.gateway_list(): db.mark_gateways([gw['mac']]) if options['aliases']: for aliases in options['aliases']: