Ejemplo n.º 1
0
        def _launch_application(self, widget=None):
            # Decide whether application prompts user to plug in WiFi dongle
            # or tell them they have ethernet.
            # Don't want to call this function more than once
            self.wiface = get_wlan_device()

            has_internet = is_internet()
            ethernet_plugged = is_ethernet_plugged()
            dongle_is_plugged_in = is_device(self.wiface)

            if has_internet and ethernet_plugged and self.no_confirm_ether:
                sys.exit(0)

            # For testing
            # dongle_is_plugged_in = False
            # ethernet_plugged = True
            # has_internet = False

            if has_internet and ethernet_plugged:
                self._you_are_connected_via_ethernet()

            elif dongle_is_plugged_in:
                if has_internet:
                    self._you_have_internet_screen(self.wiface)
                else:
                    # Refresh the networks list
                    self.refresh_networks()

            else:
                self._plug_in_wifi_dongle()
Ejemplo n.º 2
0
        def _launch_application(self, widget=None):
            # Decide whether application prompts user to plug in WiFi dongle
            # or tell them they have ethernet.
            # Don't want to call this function more than once
            self.wiface = get_wlan_device()

            has_internet = is_internet()
            ethernet_plugged = is_ethernet_plugged()
            dongle_is_plugged_in = is_device(self.wiface)

            if has_internet and ethernet_plugged and self.no_confirm_ether:
                sys.exit(0)

            # For testing
            # dongle_is_plugged_in = False
            # ethernet_plugged = True
            # has_internet = False

            if has_internet and ethernet_plugged:
                self._you_are_connected_via_ethernet()

            elif dongle_is_plugged_in:
                if has_internet:
                    self._you_have_internet_screen(self.wiface)
                else:
                    # Refresh the networks list
                    self.refresh_networks()

            else:
                self._plug_in_wifi_dongle()
Ejemplo n.º 3
0
 def _decide(self):
     if is_device(self.wiface):
         self.refresh_networks()
     else:
         self._plug_in_wifi_dongle()
Ejemplo n.º 4
0
 def _ethernet_next_step(self, widget=None):
     dongle_is_plugged_in = is_device(self.wiface)
     if dongle_is_plugged_in:
         self.refresh_networks()
     else:
         self._plug_in_wifi_dongle()
Ejemplo n.º 5
0
 def _decide(self):
     if is_device(self.wiface):
         self.refresh_networks()
     else:
         self._plug_in_wifi_dongle()
Ejemplo n.º 6
0
 def _ethernet_next_step(self, widget=None):
     dongle_is_plugged_in = is_device(self.wiface)
     if dongle_is_plugged_in:
         self.refresh_networks()
     else:
         self._plug_in_wifi_dongle()