Example #1
0
def show_scan_results():
    network_menu_contents = []
    networks = wpa_cli.get_scan_results()
    for network in networks:
        network_menu_contents.append([network['ssid'], lambda x=network: network_info_menu(x)])
    network_menu = Menu(network_menu_contents, i, o, "Wireless network menu")
    network_menu.activate()
Example #2
0
 def check_connect_wifi(self):
     if self.badnet is not None:
         self.badnets.append(self.badnet)
         self.badnet = None
     status = wpa_cli.connection_status()
     state = status["wpa_state"]
     if state == "COMPLETED":
         return status
     else:
         print("Not connected, retrying!")
         wpa_cli.scan()
         sleep(5)
         avail_networks = wpa_cli.get_scan_results()
         for network in avail_networks:
             if network["bssid"] in self.badnets:
                 print("Avoiding bad network {}".format(network["bssid"]))
                 continue
             elif wpa_cli.is_open_network(network):
                 #Adding net network, gotta reset the smash counter
                 self.smash_counter = 0
                 id = wpa_cli.add_open_network(network)
                 wpa_cli.select_network(id)
                 print("Selected '{}'".format(network["ssid"]))
                 sleep(5)
                 print("Hope we got the IP now")
                 return
         return None
Example #3
0
def show_scan_results():
    network_menu_contents = []
    networks = wpa_cli.get_scan_results()
    for network in networks:
        network_menu_contents.append(
            [network['ssid'], lambda x=network: network_info_menu(x)])
    network_menu = Menu(network_menu_contents, i, o, "Wireless network menu")
    network_menu.activate()
Example #4
0
def show_scan_results():
    network_menu_contents = []
    networks = wpa_cli.get_scan_results()
    for network in networks:
        if network["ssid"] == '':
            ssid = '[Hidden]'
        elif network["ssid"]:
            ssid = network["ssid"]
        network_menu_contents.append([ssid, lambda x=network: network_info_menu(x)])
    network_menu = Menu(network_menu_contents, i, o, "Wireless network menu")
    network_menu.activate()