コード例 #1
0
ファイル: newMote.py プロジェクト: Paolo-Maffei/mansos
    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()
コード例 #2
0
ファイル: newMote.py プロジェクト: ssureshkumar/osw
    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()