hab n kleines Problem mit meinem Account-Manager.
Ich habe das System in den neuen Clienten eingefügt, es klappt alles wunderbar, ich kann die Daten speichern & löschen, aber etwas funktioniert nicht:
Nämlich; -> Verbinden zum Server
Sobald ich den Button "start" klicke (vom Acc-Board) kommt "Fehlerhafte ID oder fehlerhaftes Passwort". Habe dann 'n kleinen Check eingebaut und warum auch immer fügt er beim lesen ein Leerzeichen zum Schluss ein.
(Hinter die ID und dem Passwort). Hab' fast die ganze Nacht durchgeschaut und komme einfach nicht drauf was falsch ist, denn früher (im 2013er Clienten) ging es ja auch so..
Code:
def __LoadACCInfos(self, accid): import linecache login = linecache.getline("settings/loginsetting"+str(accid)+ ".cfg",1) password = linecache.getline("settings/loginsetting"+str(accid)+ ".cfg",2) self.idEditLine.SetText(login) self.pwdEditLine.SetText(password) id = self.idEditLine.GetText() id = id.replace('\n', "") linecache.clearcache() def __OnClickACC1LoginButton(self): self.__LoadACCInfos(1) def __OnClickACC2LoginButton(self): self.__LoadACCInfos(2) def __OnClickACC3LoginButton(self): self.__LoadACCInfos(3) def __OnClickACC4LoginButton(self): self.__LoadACCInfos(4) def __OnClickACC5LoginButton(self): self.__LoadACCInfos(5) def __OnClickedit_patrick(self): if constInfo.edit == 0: self.__Edit() constInfo.edit = 1 return if constInfo.edit == 1: self.acc1loginButton.Show() self.acc2loginButton.Show() self.acc3loginButton.Show() self.acc4loginButton.Show() self.acc5loginButton.Show() self.Acc1Del.Hide() self.Acc2Del.Hide() self.Acc3Del.Hide() self.Acc4Del.Hide() self.Acc5Del.Hide() self.LoginSaveButton1.Hide() self.LoginSaveButton2.Hide() self.LoginSaveButton3.Hide() self.LoginSaveButton4.Hide() self.LoginSaveButton5.Hide() self.ACC1__LABEL.Hide() self.ACC2__LABEL.Hide() self.ACC3__LABEL.Hide() self.ACC4__LABEL.Hide() self.ACC5__LABEL.Hide() self.__LoadACCNames() constInfo.edit = 0 def __Edit(self): self.acc1loginButton.Hide() self.acc2loginButton.Hide() self.acc3loginButton.Hide() self.acc4loginButton.Hide() self.acc5loginButton.Hide() self.Acc1Del.Show() self.Acc2Del.Show() self.Acc3Del.Show() self.Acc4Del.Show() self.Acc5Del.Show() self.LoginSaveButton1.Show() self.LoginSaveButton2.Show() self.LoginSaveButton3.Show() self.LoginSaveButton4.Show() self.LoginSaveButton5.Show() self.ACC1__LABEL.Show() self.ACC2__LABEL.Show() self.ACC3__LABEL.Show() self.ACC4__LABEL.Show() self.ACC5__LABEL.Show() self.__LoadACCNames() def __LoadACCNames(self): fd = open( "settings/loginsetting1.cfg" ) login1 = fd.readline() login1.replace("\n","") fd.close() fd = open( "settings/loginsetting2.cfg" ) login2 = fd.readline() login2.replace("\n","") fd.close() fd = open( "settings/loginsetting3.cfg" ) login3 = fd.readline() login3.replace("\n","") fd.close() fd = open( "settings/loginsetting4.cfg" ) login4 = fd.readline() login4.replace("\n","") fd.close() fd = open( "settings/loginsetting5.cfg" ) login5 = fd.readline() login5.replace("\n", "") fd.close() if login1 != "": self.ACC1__LABEL.SetText(login1) self.ACC1_LABEL.SetText(login1) if login2 != "": self.ACC2__LABEL.SetText(login2) self.ACC2_LABEL.SetText(login2) if login3 != "": self.ACC3__LABEL.SetText(login3) self.ACC3_LABEL.SetText(login3) if login4 != "": self.ACC4__LABEL.SetText(login4) self.ACC4_LABEL.SetText(login4) if login5 != "": self.ACC5__LABEL.SetText(login5) self.ACC5_LABEL.SetText(login5) def __OnClickLoginSaveButton1(self): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() fd = open( "settings/loginsetting1.cfg" ) login1 = fd.readline() login1.replace( "\n", "" ) fd.close() if login1 == "": slot = 1 else: self.PopupNotifyMessage("Der Slot ist bereits besetzt") return f = open("settings/loginsetting" + str(slot) + ".cfg", "w") f.write (id) f.write (pwd) f.close() self.PopupNotifyMessage("Deine Daten wurden erfolgreich gespeichert.") self.__LoadACCNames() def __OnClickLoginSaveButton2(self): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() fd = open( "settings/loginsetting2.cfg" ) login2 = fd.readline() login2.replace( "\n", "" ) fd.close() if login2 == "": slot = 2 else: self.PopupNotifyMessage("Der Slot ist bereits besetzt") return f = open("settings/loginsetting" + str(slot) + ".cfg", "w") f.write (id) f.write (pwd) f.close() self.PopupNotifyMessage("Deine Daten wurden erfolgreich gespeichert.") self.__LoadACCNames() def __OnClickLoginSaveButton3(self): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() fd = open( "settings/loginsetting3.cfg" ) login3 = fd.readline() login3.replace( "\n", "" ) fd.close() if login3 == "": slot = 3 else: self.PopupNotifyMessage("Der Slot ist bereits besetzt") return f = open("settings/loginsetting" + str(slot) + ".cfg", "w") f.write (id +"\n") f.write (pwd) f.close() self.PopupNotifyMessage("Deine Daten wurden erfolgreich gespeichert.") self.__LoadACCNames() def __OnClickLoginSaveButton4(self): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() fd = open( "settings/loginsetting4.cfg" ) login4 = fd.readline() login4.replace( "\n", "" ) fd.close() if login4 == "": slot = 4 else: self.PopupNotifyMessage("Der Slot ist bereits besetzt") return f = open("settings/loginsetting" + str(slot) + ".cfg", "w") f.write (id +"\n") f.write (pwd) f.close() self.PopupNotifyMessage("Deine Daten wurden erfolgreich gespeichert.") self.__LoadACCNames() def __OnClickLoginSaveButton5(self): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() fd = open( "settings/loginsetting5.cfg" ) login5 = fd.readline() login5.replace( "\n", "" ) fd.close() if login5 == "": slot = 5 else: self.PopupNotifyMessage("Der Slot ist bereits besetzt") return f = open("settings/loginsetting" + str(slot) + ".cfg", "w") f.write (id +"\n") f.write (pwd) f.close() self.PopupNotifyMessage("Deine Daten wurden erfolgreich gespeichert.") self.__LoadACCNames() def __OnClickAcc1DelButton(self): f = open("settings/loginsetting1.cfg", "w") f.write ("") f.close() self.ACC1__LABEL.SetText("Freier Slot") self.ACC1_LABEL.SetText("Freier Slot") self.__LoadACCNames() def __OnClickAcc2DelButton(self): f = open("settings/loginsetting2.cfg", "w") f.write ("") f.close() self.ACC2__LABEL.SetText("Freier Slot") self.ACC2_LABEL.SetText("Freier Slot") self.__LoadACCNames() def __OnClickAcc3DelButton(self): f = open("settings/loginsetting3.cfg", "w") f.write ("") f.close() self.ACC3__LABEL.SetText("Freier Slot") self.ACC3_LABEL.SetText("Freier Slot") self.__LoadACCNames() def __OnClickAcc4DelButton(self): f = open("settings/loginsetting4.cfg", "w") f.write ("") f.close() self.ACC4__LABEL.SetText("Freier Slot") self.ACC4_LABEL.SetText("Freier Slot") self.__LoadACCNames() def __OnClickAcc5DelButton(self): f = open("settings/loginsetting5.cfg", "w") f.write ("") f.close() self.ACC5__LABEL.SetText("Freier Slot") self.ACC5_LABEL.SetText("Freier Slot") self.__LoadACCNames() def __OnClickaccbutton_patrick(self): if constInfo.accboard == 0: self.accboard.Show() constInfo.accboard = 1 return if constInfo.accboard == 1: self.accboard.Hide() constInfo.accboard = 0
Naja, bin ziemlich müde und hoffe auf bisschen Unterstützung.
Sorry, bin grad nicht mächtig genug mich zu artikulieren.
Patrick