Re: Protecting against callbacks queuing up?

2009-08-28 Thread Hendrik van Rooyen
On Friday 28 August 2009 00:42:16 Esben von Buchwald wrote: OK, now things starts to make sense. You tell me to do something like this? def doCallback(self): if self.process_busy==False: self.process_busy=True self.at.after(0.01,self.data_callback)

Re: Protecting against callbacks queuing up?

2009-08-28 Thread Esben von Buchwald
It seems to solve the problem. What I did: def contextDataHandler(self): self.contextdata.process_busy=True self.services.findServices() self.drawDisplay() self.contextdata.process_busy=False def doCallback(self): self.at.cancel() if

Re: Protecting against callbacks queuing up?

2009-08-26 Thread Esben von Buchwald
Hendrik van Rooyen wrote: would that be usable? Probably If so, how? This is a guess, for your device, but I suspect something along these lines: t = Ao_timer() cb = t.after(100,thing_that_does_the_work(with_its_arguments)) Lots of assumptions here - the 100 should give you a tenth of a

Re: Protecting against callbacks queuing up?

2009-08-26 Thread Esben von Buchwald
Dennis Lee Bieber wrote: On Tue, 25 Aug 2009 15:21:16 +0200, Esben von Buchwald find@paa.google declaimed the following in gmane.comp.python.general: This is how the accelerometer is accessed http://pys60.garage.maemo.org/doc/s60/node59.html I found this called after...

Re: Protecting against callbacks queuing up?

2009-08-25 Thread Hendrik van Rooyen
On Monday 24 August 2009 17:32:23 Esben von Buchwald wrote: Hendrik van Rooyen wrote: 8 -- some stuff about an after call -- I'm new to python, what is an after function and an after call? Couldn't find excact answer on google...? Do you have a link to some

Re: Protecting against callbacks queuing up?

2009-08-25 Thread Esben von Buchwald
Dennis Lee Bieber wrote: On Mon, 24 Aug 2009 17:32:23 +0200, Esben von Buchwald find@paa.google declaimed the following in gmane.comp.python.general: I'm new to python, what is an after function and an after call? Couldn't find excact answer on google...? Do you have a link to some docs?

Re: Protecting against callbacks queuing up?

2009-08-25 Thread Hendrik van Rooyen
On Tuesday 25 August 2009 15:21:16 Esben von Buchwald wrote: Dennis Lee Bieber wrote: On Mon, 24 Aug 2009 17:32:23 +0200, Esben von Buchwald find@paa.google declaimed the following in gmane.comp.python.general: I'm new to python, what is an after function and an after call? Couldn't

Re: Protecting against callbacks queuing up?

2009-08-24 Thread Hendrik van Rooyen
On Monday 24 August 2009 02:14:24 Esben von Buchwald wrote: Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a

Re: Protecting against callbacks queuing up?

2009-08-24 Thread Esben von Buchwald
Hendrik van Rooyen wrote: see if there is an after method somewhere. What you have to do is to break the link between the callback and the processing. Your code above is all in the callback thread, despite the fact that you call another function to do the processing. So if you replace the

Re: Protecting against callbacks queuing up?

2009-08-24 Thread ryles
On Aug 23, 8:14 pm, Esben von Buchwald find@paa.google wrote: I thought that this code would do the trick, but it obviously doesn't help at all, and i can't understand why...      def doCallback(self):          if self.process_busy==False:              self.process_busy=True            

Protecting against callbacks queuing up?

2009-08-23 Thread Esben von Buchwald
Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a function defined by me, every time new data is available. The

Re: Protecting against callbacks queuing up?

2009-08-23 Thread MRAB
Esben von Buchwald wrote: Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a function defined by me, every time new