View Single Post
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#2
Just a rough explanation.

When you start the GPS register the time
Code:
global StartTime
StartTime = time.time()
Then in the function you listen for the GPS changes add a check
Code:
PastTime = time.time() - StartTime
if PastTime >= GPSTIMEOUT:
   data.stop()
ofcourse you need to import time.

I think this is all you need to make it work, this is also how the smscon_daemon does it.

Last edited by Saturn; 2011-05-30 at 20:55. Reason: better tabs in the code