Exemplo n.º 1
0
    def listAccessPoints(self):
        self.APList = []
        if self.WlanPluginInstalled is False:
            self.APList.append((_("No networks found"), None))
        else:
            from Plugins.SystemPlugins.WirelessLan.Wlan import iWlan
            iWlan.setInterface(self.selectedInterface)
            self.w = iWlan.getInterface()
            aps = iWlan.getNetworkList()
            if aps is not None:
                print "[NetworkWizard.py] got Accespoints!"
                tmplist = []
                complist = []
                for ap in aps:
                    a = aps[ap]
                    if a['active']:
                        tmplist.append((a['bssid'], a['essid']))
                        complist.append((a['bssid'], a['essid']))

                for entry in tmplist:
                    if entry[1] == "":
                        for compentry in complist:
                            if compentry[0] == entry[0]:
                                complist.remove(compentry)
                for entry in complist:
                    self.APList.append((entry[1], entry[1]))
            if not len(aps):
                self.APList.append((_("No networks found"), None))

        self.rescanTimer.start(4000)
        return self.APList
Exemplo n.º 2
0
	def listAccessPoints(self):
		self.APList = []
		if self.WlanPluginInstalled is False:
			self.APList.append( ( _("No networks found"), None ) )
		else:
			from Plugins.SystemPlugins.WirelessLan.Wlan import iWlan
			iWlan.setInterface(self.selectedInterface)
			self.w = iWlan.getInterface()
			aps = iWlan.getNetworkList()
			if aps is not None:
				print "[NetworkWizard.py] got Accespoints!"
				tmplist = []
				complist = []
				for ap in aps:
					a = aps[ap]
					if a['active']:
						tmplist.append( (a['bssid'], a['essid']) )
						complist.append( (a['bssid'], a['essid']) )

				for entry in tmplist:
					if entry[1] == "":
						for compentry in complist:
							if compentry[0] == entry[0]:
								complist.remove(compentry)
				for entry in complist:
					self.APList.append( (entry[1], entry[1]) )
			if not len(aps):
				self.APList.append( ( _("No networks found"), None ) )

		self.rescanTimer.start(4000)
		return self.APList
Exemplo n.º 3
0
    def __init__(self, session, iface):
        Screen.__init__(self, session)
        self.session = session
        self.iface = iface
        self.skin_path = plugin_path
        self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up")
        self.APList = None
        self.newAPList = None
        self.WlanList = None
        self.cleanList = None
        self.oldlist = {}
        self.listLength = None
        self.divpng = LoadPixmap(
            path=resolveFilename(SCOPE_CURRENT_SKIN, "div-h.png"))

        self.rescanTimer = eTimer()
        self.rescanTimer.callback.append(self.rescanTimerFired)

        self["info"] = StaticText()

        self.list = []
        self["list"] = List(self.list)

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Connect"))
        self["key_yellow"] = StaticText()

        self["actions"] = NumberActionMap(
            ["WizardActions", "InputActions", "EPGSelectActions"], {
                "ok": self.select,
                "back": self.cancel,
            }, -1)

        self["shortcuts"] = ActionMap(["ShortcutActions"], {
            "red": self.cancel,
            "green": self.select,
        })
        iWlan.setInterface(self.iface)
        self.w = iWlan.getInterface()
        self.onLayoutFinish.append(self.layoutFinished)
        self.getAccessPoints(refresh=False)
Exemplo n.º 4
0
    def listAccessPoints(self):
        self.APList = []
        if self.WlanPluginInstalled is False:
            self.APList.append((_("No networks found"), _("unavailable")))
            return self.APList
        else:
            try:
                from Plugins.SystemPlugins.WirelessLan.Wlan import iWlan
                iWlan.setInterface(self.selectedInterface)
                self.w = iWlan.getInterface()
                aps = iWlan.getNetworkList()
            except ValueError:
                self.APList = []
                self.APList.append((_("No networks found"), _("unavailable")))
                return self.APList

            if aps is not None:
                print "[NetworkWizard.py] got Accespoints!"
                tmplist = []
                complist = []
                for ap in aps:
                    a = aps[ap]
                    if a['active']:
                        tmplist.append((a['bssid'], a['essid']))
                        complist.append((a['bssid'], a['essid']))

                for entry in tmplist:
                    if entry[1] == "":
                        for compentry in complist:
                            if compentry[0] == entry[0]:
                                complist.remove(compentry)
                for entry in complist:
                    self.APList.append((entry[1], entry[1]))

            if "<hidden>" not in self.APList:
                self.APList.append(
                    (_("enter hidden network SSID"), "<hidden>"))

            self.rescanTimer.start(5000)
            return self.APList
Exemplo n.º 5
0
	def listAccessPoints(self):
		self.APList = []
		if self.WlanPluginInstalled is False:
			self.APList.append( ( _("No networks found"),_("unavailable") ) )
			return self.APList
		else:
			try:
				from Plugins.SystemPlugins.WirelessLan.Wlan import iWlan
				iWlan.setInterface(self.selectedInterface)
				self.w = iWlan.getInterface()
				aps = iWlan.getNetworkList()
			except ValueError:
				self.APList = []
				self.APList.append( ( _("No networks found"),_("unavailable") ) )
				return self.APList

			if aps is not None:
				print "[NetworkWizard.py] got Accespoints!"
				tmplist = []
				complist = []
				for ap in aps:
					a = aps[ap]
					if a['active']:
						tmplist.append( (a['bssid'], a['essid']) )
						complist.append( (a['bssid'], a['essid']) )
				
				for entry in tmplist:
					if entry[1] == "":
						for compentry in complist:
							if compentry[0] == entry[0]:
								complist.remove(compentry)
				for entry in complist:
					self.APList.append( (entry[1], entry[1]) )

			if "<hidden>" not in self.APList:
				self.APList.append(( _("enter hidden network SSID"), "<hidden>" ))
			
			self.rescanTimer.start(5000)
			return self.APList
Exemplo n.º 6
0
def callFunction(iface):
    iWlan.setInterface(iface)
    i = iWlan.getWirelessInterfaces()
    if iface in i or iNetwork.isWirelessInterface(iface):
        return WlanStatusScreenMain
    return None