コード例 #1
0
ファイル: cmd.py プロジェクト: tegola-hubs/dendria
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
コード例 #2
0
ファイル: server.py プロジェクト: tegola-hubs/dendria
 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")