Author: simplet
Date: 2008-11-29 17:51:59 +0100 (Sat, 29 Nov 2008)
New Revision: 2925

Modified:
   
software_suite_v2/software/scripts/ThunderBird_DBUS/AlerteEmailDbusThunderbird_2.py
   software_suite_v2/software/scripts/ThunderBird_DBUS/readEmail.py
Log:
* Resolved the encoding bug that screwed the tts and the script. I had to 
encode to utf8 then to latin1.


Modified: 
software_suite_v2/software/scripts/ThunderBird_DBUS/AlerteEmailDbusThunderbird_2.py
===================================================================
--- 
software_suite_v2/software/scripts/ThunderBird_DBUS/AlerteEmailDbusThunderbird_2.py
 2008-11-29 16:49:22 UTC (rev 2924)
+++ 
software_suite_v2/software/scripts/ThunderBird_DBUS/AlerteEmailDbusThunderbird_2.py
 2008-11-29 16:51:59 UTC (rev 2925)
@@ -43,7 +43,7 @@
 
 
 def OnEmail(subject, author):
-  os.system(os.getcwd()+"/readEmail.py \"" + author.split("<")[0] + "\" \"" + 
subject + "\"")
+  os.system(os.getcwd()+"/readEmail.py \"" + 
author.split("<")[0].encode("utf8") + "\" \"" + subject.encode("utf8") + "\"")
 
 
 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

Modified: software_suite_v2/software/scripts/ThunderBird_DBUS/readEmail.py
===================================================================
--- software_suite_v2/software/scripts/ThunderBird_DBUS/readEmail.py    
2008-11-29 16:49:22 UTC (rev 2924)
+++ software_suite_v2/software/scripts/ThunderBird_DBUS/readEmail.py    
2008-11-29 16:51:59 UTC (rev 2925)
@@ -6,15 +6,7 @@
  This script is called by the "Thunderbird DBUS Tux script".
  
  Author: Simplet <simplet _at_ ptigeek _dot_ net>
- 
- 
- 
- BUG:
- ====
- 
- - I have a problem when I receive email with é è in the subject.
-   Python throw an exception, saying it can't decode/encode :(
- 
+   
 """
 
 __author__  = 'Simplet <simplet _at_ ptigeek _dot_ net>'
@@ -35,8 +27,9 @@
 
 def SayThat(text):
   tux.led.both.blinkAsync(4,25, LFX_FADE)
+  tux.soundFlash.play(16)
   text = unicode(text, sys.stdin.encoding)
-  text = text.encode("utf8")
+  text = text.encode("latin1")
   tux.tts.speak(text, "Julie", 100)
   tux.led.both.off()
 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to