def censored_wigle_thread(device, ap): brand = Censor.brand(device.get_brand()) str_ = '' if brand: str_ = '{} ({}) -> {}'.format(Censor.mac(device.mac_address), brand, Censor.ssid(ap.ssid)) else: str_ = '{} -> {}'.format(device.mac_address, ap.ssid) wigle_data = ap.get_wigle_data() # this could take a while if not wigle_data: print(str_) return str_ += ' ({} results)'.format(wigle_data['resultCount']) print(str_) results = wigle_data['results'] for result in results: str_ = '\t{},{}: '.format(Censor.gps(result['trilat']), Censor.gps(result['trilong'])) country = Censor.country(result["country"]) region = Censor.region(result["region"]) city = Censor.city(result["city"]) postalcode = Censor.postalcode(result["postalcode"]) street = Censor.road(result["road"]) house_number = Censor.housenumber(result["housenumber"]) last_update = result["lastupdt"] str_ += '{} - {} - {} - {} - {} - {} ({})'.format( country, region, city, postalcode, street, house_number, last_update) print(str_)