"kakada" <[EMAIL PROTECTED]> wrote > I have problem with function jumping:
I'm not sure what you mean by "function jumping" but I'll make a few comments... > in my class, I have three function here: > > def gotoNextFuzzy(self): > state = "isfuzzy" > self.navigationNext(state) > > def gotoNextFuzzy(self): > state = "isapproved" > self.navigationNext(state) As Luke pointed out these are the same so only the second one will actually be present. Note that you set state but it is only a local variable within the method, it will not persist outside the method so you cannot access it, I suspect you meant to write self.state = "isapproved" > def navigationNext(self,state): > if (self.getCurrentItem() == 0): > return 0 > id = int(self.item.text(0)) > for i in range(id,775): > i += 1 I'm not sure why you immediately add one. you could change the values in range() to get the same result: for i in range(1,776): > state = Its not clear what you are assigning here? An unprintable character or a typo? > if (i == 775): > self.warningMessage() > else: > if self.store.units[i].state(): > curItem = self.ui.treeWidget.topLevelItem(i) > self.ui.treeWidget.setCurrentItem(curItem) > > self.ui.txtSource.setHtml(self.store.units[i].source) > > self.ui.txtTarget.setHtml(self.store.units[i].target) > break The indentation changes here but you refer to self which suggests they should be inside the class. I'm not sure if thats intentional(and thus an error?) or just a freak of email... > and one calling built-in function: > > QtCore.QObject.connect(self.ui.btnNF,QtCore.SIGNAL("pressed()"),self.gotoNextFuzzy) > and error said: > Attribute Error: no attribute state OK, but at what point did it say that? What does the stack trace in the error say? > and if I do as follow: > > if self.store.units[i].isfuzzy(): > then it works. So what is the problem? Like Luke I'm not sure I understand what you are trying to do here. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor