Hi,
I post on the forum a new version, now Tuxdroid speaks with TTS voices
that say the contact on pidgin. I can't really test because I haven't
got tuxdroid, so I need somebody test and say if it run.

Thanks

Julien

2007/5/22, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
[EMAIL PROTECTED] writes:

> Very nice!
> I was also looking at Tux and DBus recently.. I need to get back to
> that. Thanks for the reminder!
>
> //m

Speaking of which, if you intend to add DBus support to Tux, this post
on Planet Gnome is an interesting read (and the example happens to be
about Gaim's use of DBus):

"Best D-Bus Practices"
http://swik.net/GNOME/Planet+GNOME/Havoc+Pennington:+Best+D-Bus+Practices/7rss

        Damien

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
tux-droid-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-user

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# -----------------------------------------------------------------------------
# Tux Droid - Pidgin InterFace
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# -----------------------------------------------------------------------------
# $Id: $
# -----------------------------------------------------------------------------

"""
CHANGES
=======
2007/05/26 - version 0.2:
    - Tuxdroid speaks with TTS voices that say the contact on pidgin

2007/05/21 - version 0.1:
    - Initial version

TODO LIST
=========
- Make some actions when a conversation started
- Internationalization
- Improvement of conversion received message (html2text)

"""

__author__  = "Thomas CARPENTIER <[EMAIL PROTECTED]> & Julien Ruchaud"
__appname__ = "TuxPidgin"
__version__ = "0.2"
__date__    = "2007/05/26"
__license__ = "GPL"

# -----------------------------------------------
# Initalization of modules
# uses objects "tux" and "tss"
# -----------------------------------------------
import sys
sys.path.append('/opt/tuxdroid/api/python')
from tux import *

# Others
import dbus
import dbus.glib
import dbus.decorators
import gobject
import os
import re

# This method is excute when a message is receive
def receivedimmsg(account, name, message, conversation, flags):
    buddy = purple.PurpleFindBuddy(account, name)
    if buddy != 0:
        alias = purple.PurpleBuddyGetAlias(buddy)
    else:
        alias = name

    text = "%s says %s" % (alias, message)
    text = re.sub("<.*?>", "", text)#html2text
    tuxspeak(text)

# This method is excute when a buddy is sign on
def buddysignedon(buddyid):
    alias = purple.PurpleBuddyGetAlias(buddyid)

    text = "%s is online" % alias
    tuxspeak(text)

# Tux speak the text   
def tuxspeak(text):
    print text
    tux.cmd.mouth_open()
    tux.tts.select_voice(2,100)
    tux.tts.speak(text)
    tux.cmd.mouth_close()

# Main
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")

bus.add_signal_receiver(receivedimmsg,
                        dbus_interface = "im.pidgin.purple.PurpleInterface",
                        signal_name = "ReceivedImMsg")

bus.add_signal_receiver(buddysignedon,
                        dbus_interface = "im.pidgin.purple.PurpleInterface",
                        signal_name = "BuddySignedOn")

print "TuxPidgin is started"
loop = gobject.MainLoop()
loop.run()
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
tux-droid-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-user

Reply via email to