Author: jerome
Date: 2009-05-07 11:55:43 +0200 (Thu, 07 May 2009)
New Revision: 4649

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
Log:
* Fixed a dummy bug.

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
   2009-05-07 08:19:30 UTC (rev 4648)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
   2009-05-07 09:55:43 UTC (rev 4649)
@@ -67,10 +67,8 @@
 from tuxisalive.api import *
 from time import sleep, time
 from GadgetHelper import GadgetHelper
-import threading
+import threading   
 
-currentTime = 0;    
-
 def tuxConnect():
     '''
     Wait connected
@@ -132,6 +130,7 @@
     Tux stop when it finds light up Modified by ks156 who wrote light 
     monitor gadget for TuxDroid V1 Tux turn a little, wait and turn while 
light < light max 
     '''
+    brk = False
     while 1:
         
         tux.spinning.leftOnDuring(0.1, speed=SPV_VERYSLOW)
@@ -143,12 +142,13 @@
             break
             
         if (int(time()) - currentTime) >= 20:
-            throwMessage("Sorry I'm not sure where the most of the light is 
coming from")
-            break;
+            GadgetHelper.throwMessage("Sorry I'm not sure where the most of 
the light is coming from")
+            tux.spinning.off()
+            brk = True
+            break
             
-        currentTime = int(time())
-            
-    GadgetHelper.throwMessage("I think most of the light is coming from this 
direction.")
+    if not brk:        
+        GadgetHelper.throwMessage("I think most of the light is coming from 
this direction.")
 
 
 tgp_language = "en"
@@ -181,8 +181,7 @@
         tux.eyes.open()
         tux.flippers.up()
         light = search() # search light up
-        currentTime = int(time())
-        stop(light, currentTime)    # stop
+        stop(light, int(time()))    # stop
         tux.flippers.down()
         
 tux.access.release()


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to