Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py~
diff options
context:
space:
mode:
Diffstat (limited to 'activity.py~')
-rw-r--r--activity.py~47
1 files changed, 45 insertions, 2 deletions
diff --git a/activity.py~ b/activity.py~
index 7977c2f..7e8e2d1 100644
--- a/activity.py~
+++ b/activity.py~
@@ -26,6 +26,7 @@ from sugar.activity.widgets import ActivityToolbox
from sugar.activity.widgets import TitleEntry
from sugar.activity.widgets import StopButton
from sugar.activity.widgets import ShareButton
+from ConfigParser import SafeConfigParser
class AudioPatternActivity(activity.Activity):
@@ -69,6 +70,7 @@ class AudioPatternActivity(activity.Activity):
jugarButton = gtk.Button()
principalVbox.pack_start(cabeceraHbox, fill=False)
jugarButton.set_label('JUGAR')
+ jugarButton.connect('focus-in-event', self.__say_text)
cabeceraHbox.pack_start(jugarButton, fill=False)
jugarButton.set_size_request(150, 50)
@@ -89,12 +91,19 @@ class AudioPatternActivity(activity.Activity):
self.connect('key-press-event', self.__on_key_press_event)
+ parser = SafeConfigParser()
+ parser.read('config.ini')
+
seleccionadosTable = gtk.Table(4, 1, True)
seleccionadoUnoButton = gtk.Button()
seleccionadoDosButton = gtk.Button()
seleccionadoTresButton = gtk.Button()
#resultadoButton = gtk.Button()
+ seleccionadoUnoButton.connect('focus-in-event', self.__say_text)
+ seleccionadoDosButton.connect('focus-in-event', self.__say_text)
+ seleccionadoTresButton.connect('focus-in-event', self.__say_text)
+
opcionesTable = gtk.Table(3,3, True)
opcionUno = gtk.Button()
opcionDos = gtk.Button()
@@ -105,7 +114,36 @@ class AudioPatternActivity(activity.Activity):
opcionSiete = gtk.Button()
opcionOcho = gtk.Button()
opcionNueve = gtk.Button()
-
+
+ opcionUno.connect('focus-in-event', self.__say_text)
+ opcionDos.connect('focus-in-event', self.__say_text)
+ opcionTres.connect('focus-in-event', self.__say_text)
+ opcionCuatro.connect('focus-in-event', self.__say_text)
+ opcionCinco.connect('focus-in-event', self.__say_text)
+ opcionSeis.connect('focus-in-event', self.__say_text)
+ opcionSiete.connect('focus-in-event', self.__say_text)
+ opcionOcho.connect('focus-in-event', self.__say_text)
+ opcionNueve.connect('focus-in-event', self.__say_text)
+
+ uno = parser.get('cantidad', 'tres') + ' ' + parser.get('elemento', 'leones') + ' de ' + parser.get('material', 'metal')
+ opcionUno.set_label(uno)
+ dos = parser.get('cantidad', 'cuatro') + ' ' + parser.get('elemento', 'jirafas') + ' de ' + parser.get('material', 'madera')
+ opcionDos.set_label(dos)
+ tres = parser.get('cantidad', 'cinco') + ' ' + parser.get('elemento', 'monos') + ' de ' + parser.get('material', 'vidrio')
+ opcionTres.set_label(tres)
+ cuatro = parser.get('cantidad', 'cuatro') + ' ' + parser.get('elemento', 'leones') + ' de ' + parser.get('material', 'madera')
+ opcionCuatro.set_label(cuatro)
+ cinco = parser.get('cantidad', 'cinco') + ' ' + parser.get('elemento', 'jirafas') + ' de ' + parser.get('material', 'metal')
+ opcionCinco.set_label(cinco)
+ seis = parser.get('cantidad', 'tres') + ' ' + parser.get('elemento', 'monos') + ' de ' + parser.get('material', 'vidrio')
+ opcionSeis.set_label(seis)
+ siete = parser.get('cantidad', 'tres') + ' ' + parser.get('elemento', 'leones') + ' de ' + parser.get('material', 'madera')
+ opcionSiete.set_label(siete)
+ ocho = parser.get('cantidad', 'cuatro') + ' ' + parser.get('elemento', 'monos') + ' de ' + parser.get('material', 'metal')
+ opcionOcho.set_label(ocho)
+ nueve = parser.get('cantidad', 'cinco') + ' ' + parser.get('elemento', 'leones') + ' de ' + parser.get('material', 'vidrio')
+ opcionNueve.set_label(nueve)
+
self.set_canvas(principalVbox)
#window.add(principalVbox)
principalVbox.add(cabeceraHbox)
@@ -153,4 +191,9 @@ class AudioPatternActivity(activity.Activity):
logging.debug(widget_focus.get_label())
def __say_text(self, widget, event):
- logging.debug("djfhsdjfhsdkjfhsjkdfh")
+ label = widget.get_label()
+ logging.debug(label)
+ self.say(label)
+
+ def say(self, text):
+ Popen(['espeak', '-v', 'es', text])