def addNewMote(self, event): if not Motelist.portExists(self.port.GetValue()): self.portError.SetLabel(localize("No device found on this port") + "!") self.SetSizerAndFit(self.main) self.SetAutoLayout(1) self.Show() else: if Motelist.addMote(self.port.GetValue(), self.name.GetValue(), "User defined"): self.API.updateUserMotes() self.Close() else: self.portError.SetLabel(localize("There already is device on that port in list") + "!") self.SetSizerAndFit(self.main) self.SetAutoLayout(1) self.Show()
def addNewMote(self, event): if not Motelist.portExists(self.port.GetValue()): self.portError.SetLabel( localize("No device found on this port") + "!") self.SetSizerAndFit(self.main) self.SetAutoLayout(1) self.Show() else: if Motelist.addMote(self.port.GetValue(), self.name.GetValue(), "User defined"): self.API.updateUserMotes() self.Close() else: self.portError.SetLabel( localize("There already is device on that port in list") + "!") self.SetSizerAndFit(self.main) self.SetAutoLayout(1) self.Show()