Page 1 of 1

Construction question about Timers and Pesters

PostPosted: Thu Jun 25, 2015 2:57 pm
by zurich
Greetings,

I am hoping you could be so kind as to help me understand your idea behind building the subject plugin. I like to look at the construction of plugins to see how they are builded to help me in my knowledge of Python. Please excuse my poor technical english.

Can you tell me why you choosed to use the Timers class and Pesters class as nested classes or am I mistake here?

I looked at the code many hours but I cannot see how you call a method or variable in the Pester or Timer class from the Plugin class. I see for example pester.decrement() is called from the runConcurrentThread and pester.isDone also but pester is not capitalized like the class Pester() itself. How you do this please?

I hope I do not trouble you greatly with my questions.

Thanks to you,

Z

Re: Construction question about Timers and Pesters

PostPosted: Thu Jun 25, 2015 3:02 pm
by FlyingDiver
Lower case "pester" is an instance of upper case Class Pester. It's created by "pester = Pester()". So to call an instance method you do pester.decrement(). That's similar to doing something like decrement(pester) in a non-object world.

Re: Construction question about Timers and Pesters

PostPosted: Fri Jun 26, 2015 2:29 pm
by jay (support)
There are a lot of Python tutorials out on the net - I highly recommend working your way through them to get a feel for the language. It's a very rich language with great abstractions so doing a couple of the intro tutorials should give you a great start.