[tuxdroid-svn] r4645 - in software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk: execu
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-05-06 10:33:58
|
Author: jerome
Date: 2009-05-06 12:33:45 +0200 (Wed, 06 May 2009)
New Revision: 4645
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/resources/gadget.pot
Log:
* Added a tts message when radio is not detected.
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-05 14:46:45 UTC (rev 4644)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py 2009-05-06 10:33:45 UTC (rev 4645)
@@ -65,7 +65,7 @@
import locale
import gettext
from tuxisalive.api import *
-from time import sleep
+from time import sleep, time
from GadgetHelper import GadgetHelper
@@ -109,12 +109,11 @@
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
'''
-
tux.spinning.leftOnAsync(0.25, speed=SPV_VERYSLOW)
-
sleep(1)
while 1:
+ print(time())
tux.spinning.leftOnDuring(0.1, speed=1)
sleep(0.3)
lum = float(tux.status.requestOne('light_level')[0])
@@ -145,17 +144,19 @@
if tuxConnect():
+ if not tux.radio.getConnected():
+ GadgetHelper.throwMessage("I can't find my fish. Please, make sure I'm connected.")
+
# Test if charger are plugged
- if tux.status.requestOne('charger_state')[0] == 'UNPLUGGED':
+ elif not ( tux.status.requestOne('charger_state')[0] == 'UNPLUGGED' ) :
+ GadgetHelper.throwMessage("Unplug my charger first and try again.")
+ else:
GadgetHelper.throwMessage("Looking for the brightest light source")
tux.eyes.open()
tux.flippers.up()
light = search() # search light up
stop(light) # stop
tux.flippers.down()
-
- else:
- GadgetHelper.throwMessage("Unplug my charger first and try again.")
tux.access.release()
tux.server.disconnect()
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/resources/gadget.pot
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/resources/gadget.pot 2009-05-05 14:46:45 UTC (rev 4644)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/resources/gadget.pot 2009-05-06 10:33:45 UTC (rev 4645)
@@ -10,6 +10,8 @@
msgid "Unplug my charger first and try again."
msgstr ""
+msgid "I can't find my fish. Please, make sure I'm connected."
+
msgid "Looking for the brightest light source"
msgstr ""
|