def BTLogin(self, e): self.SetStatusText("Logging in.") global browser #make global for other functions browser, successFlag = BTsr.Login(emailAddress, btPassword) if not successFlag: self.SetStatusText( "Problem with logging in. Please check username/password.") else: self.SetStatusText("Log in successful. Making service request.") url = srDetails[self.choiceCombo.GetSelection()]['url'] localRef = self.localRef.GetValue() comm = self.comment.GetValue() #submit = self.confirmCheck.GetValue() submit = False attachPath = self.attachmentLabel.GetLabel() if not os.path.isfile(attachPath): attachPath = "" browser, successFlag = BTsr.logSR(browser, url, localRef, comm, submit, attachPath) #do the work if not successFlag: self.SetStatusText("Problem with logging service request.") self.findRITMButton.Disable() else: self.SetStatusText("Service Request logged.") self.findRITMButton.Enable()
def GetRITM(self, e): #note: requires global var 'browser' to exist first ritmNumber, successFlag = BTsr.getRITMNumber(browser) if successFlag: self.ritmNo.SetValue(ritmNumber) else: self.SetStatusText( "Can't work out RITM number. Please type manually.")
def BTLogin(self, e): self.SetStatusText("Logging in.") global browser #make global for other functions browser, successFlag = BTsr.Login(emailAddress, btPassword) if not successFlag: self.SetStatusText("Problem with logging in. Please check username/password.") else: self.SetStatusText("Log in successful. Making service request.") url = srDetails[self.choiceCombo.GetSelection()]['url'] localRef = self.localRef.GetValue() comm = self.comment.GetValue() #submit = self.confirmCheck.GetValue() submit = False attachPath = self.attachmentLabel.GetLabel() if not os.path.isfile(attachPath): attachPath = "" browser, successFlag = BTsr.logSR(browser, url, localRef, comm, submit, attachPath) #do the work if not successFlag: self.SetStatusText("Problem with logging service request.") self.findRITMButton.Disable() else: self.SetStatusText("Service Request logged.") self.findRITMButton.Enable()
def GetRITM(self, e): #note: requires global var 'browser' to exist first ritmNumber, successFlag = BTsr.getRITMNumber(browser) if successFlag: self.ritmNo.SetValue(ritmNumber) else: self.SetStatusText("Can't work out RITM number. Please type manually.")