def getCurrentList(): try: macs = wol.getWOLList() arps = wol.getArpList() result = [] for mac in macs: ip = "?" for arp in arps: if arp[1] == mac: ip = arp[0] break result.append(("%s\t%s" % (mac, ip), mac)) return result except Exception, ex: print "[WOL] Failed to load config:", ex return []
def doadd(self): items = [("%s\t%s" % (x[1],x[0]), x[1]) for x in wol.getArpList()] self.session.openWithCallback(self.doaddDone, ChoiceBox, list = items)
def doadd(self): items = [("%s\t%s" % (x[1], x[0]), x[1]) for x in wol.getArpList()] self.session.openWithCallback(self.doaddDone, ChoiceBox, list=items)