def spectrum(args): db = get_db(args) if args.frequency is not None: if not args.frequency.endswith("GHz"): args.frequency = args.frequency + " GHz" info = freqinfo(db, args.frequency) freqs = info.keys() freqs.sort() for f in freqs: print f freqlist = info[f] for host in freqlist: print "\t%(ssid)-30s s%(mac)s %(name)s (%(iface)s)" % host
def on_spectrum(self, request, freq=None): if freq is not None: freq = freq + " GHz" info = freqinfo(self.db, freq) return Response(json.dumps(info), mimetype="application/json")