[Tutor] playing around with function

Luke Paireepinart rabidpoobear at gmail.com
Fri Jul 28 09:19:33 CEST 2006


Where is self.ui initialized?
are these functions part of a class?
Why didn't you send the __init__ method?
why didn't you send the whole class structure?


>def gotoNextFuzzy(self):
>        state = "isfuzzy"
>        self.navigationNext(state)

>def gotoNextFuzzy(self):
>        state = "isapproved"
>        self.navigationNext(state)


These functions both have the same name.
They'll just overwrite each other.


 >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 =
state = what?

> and error said:
> Attribute Error: no attribute state
>
>   
If you give us the whole source (ideally) and the full stack trace of 
the error message it's more helpful.
I know you explain further down where the error occurs.
> ------------
> 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.
>   
it works but it doesn't work how you want it to work or what?
> ----------------
> please also note that:
> isfuzzy()
> isapproved()
> istranslated()
>
> are the boolean function in other class.
>   
...
> --------------------
>
> Does anybody have any solution on this coding style?
>
>   
I don't understand your coding style.
I suspect it's because you didn't include all of your code,
but if you did, I have no idea what you're trying to accomplish.
> Thanks,
>   
Just tryin' to help.
> da
>   
Luke


More information about the Tutor mailing list