Hello,
I have problem with function jumping:
in my class, I have three function here:
def gotoNextFuzzy(self):
state = "isfuzzy"
self.navigationNext(state)
def gotoNextFuzzy(self):
state = "isapproved"
self.navigationNext(state)
def navigationNext(self,state):
if (self.getCurrentItem() == 0):
return 0
id = int(self.item.text(0))
for i in range(id,775):
i += 1
state =
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
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
------------
Please understand my idea that I just want to replace the state in line
if self.store.units[i].state():
with isfuzzy or isapproved or istranslated...
and if I do as follow:
if self.store.units[i].isfuzzy():
then it works.
----------------
please also note that:
isfuzzy()
isapproved()
istranslated()
are the boolean function in other class.
--------------------
Does anybody have any solution on this coding style?
Thanks,
da
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor