diff options
author | Assim Deodia <assim.deodia@gmail.com> | 2008-07-09 16:34:14 (GMT) |
---|---|---|
committer | Assim Deodia <assim.deodia@gmail.com> | 2008-07-09 16:34:14 (GMT) |
commit | 421881b00310f3aa540be1a700e38a3921a13fbd (patch) | |
tree | 0ab10e3c40c066911b45bee0ce746e83159112c2 /las.py | |
parent | 2b70f37fbd9eba4413dbb80351104aa9b6f3ea66 (diff) |
GUI improved. database modified to include phoneme
Diffstat (limited to 'las.py')
-rw-r--r-- | las.py | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -91,9 +91,11 @@ class Listenspell(): self.play_sound("correct") self.points = self.points + self.skill_level self.words_correct = self.words_correct + 1 + self.word_obj.update_score(wordid) def ans_incorrect(self, wordid): self.play_sound("incorrect") + self.word_obj.update_score(wordid, "incorrect") def clear_screen(self,numlines=100): """Clear the console. @@ -136,9 +138,14 @@ class Listenspell(): def say_text(self, text): if self.init == False: - bus = dbus.SessionBus() - self.espeak_object = bus.get_object('org.laptop.Speech','/org/laptop/Speech') - self.init = True + try: + bus = dbus.SessionBus() + self.espeak_object = bus.get_object('org.laptop.Speech','/org/laptop/Speech') + self.init = True + except dbus.exceptions.DBusException: + print "Speech Server not turned on." + return False + text = str(text) self.espeak_object.SayText(text) @@ -153,4 +160,4 @@ class Listenspell(): def exit_game(self): self.say_text("goodbye") - sys.exit()
\ No newline at end of file + sys.exit() |