tux-droid-svn Mailing List for Tux Droid CE (Page 4)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: jerome <c2m...@c2...> - 2010-01-05 09:35:55
|
Author: jerome Date: 2010-01-05 10:35:47 +0100 (Tue, 05 Jan 2010) New Revision: 6032 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Skype client auto start removed. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 09:25:14 UTC (rev 6031) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 09:35:47 UTC (rev 6032) @@ -125,7 +125,6 @@ initialized = False isIncoming = False isOutgoingUser = True - clientStartedByPlugin = False ##---------------------------------------------------------------- @@ -452,10 +451,6 @@ ''' Outgoing call finished callback. ''' - #Stop Skype client if it was started by the plugin. - if self.clientStartedByPlugin: - self.connectorObj.stopClient() - self.clientStartedByPlugin = False #Send reset switches signal. self.serv.notify(END) @@ -503,9 +498,6 @@ return if self.onlineList[self.currentContact] == 'Quit gadget': - if self.clientStartedByPlugin: - self.connectorObj.stopClient() - self.clientStartedByPlugin = False self.serv.notify(END) else: self.synchronious.call(self.onlineList[self.currentContact]) @@ -568,13 +560,10 @@ elif self.isOutgoingUser: if not self.connectorObj.isClientRunning(): - self.clientStartedByPlugin = True - thread = threading.Thread(target=self.connectorObj.startClient) - thread.start() - - self.serv.notify(COMMAND_TTS + "Please, login to your Skype account or push my head button to quit gadget") - self.OnSkypeStarted() - + self.serv.notify(COMMAND_TTS + "Please, login to your Skype account.") + #Wait tts ends. + time.sleep(5.0) + self.serv.notify(END) if self.initialized: #Then interface outgoing call. self.serv.notify(COMMAND_OUTGOING_USER) @@ -653,13 +642,6 @@ #Reset values. self.isIncoming = False self.isOutgoingUser = True - #Quit Skype client if started bu outgoing plugin. - try: - if self.clientStartedByPlugin: - self.connectorObj.stopClient() - self.clientStartedByPlugin = False - except: - pass |
From: jerome <c2m...@c2...> - 2010-01-05 09:25:22
|
Author: jerome Date: 2010-01-05 10:25:14 +0100 (Tue, 05 Jan 2010) New Revision: 6031 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Reset Tux Droid switches and close all call when gadget stops ( power off rc button ). Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 09:14:59 UTC (rev 6030) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 09:25:14 UTC (rev 6031) @@ -169,6 +169,12 @@ if self.getCommand() == 'check': self.serv.stop() if self.getCommand() == 'run': + self.throwNotification("start") + self.throwActuation("downFlippers") + self.throwActuation("closeMouth") + self.throwNotification("stop") + self.stopTTS() + self.client.notify(CLOSE_CALL) self.client.stop() except: pass @@ -279,11 +285,6 @@ self.throwNotification("stop") elif Message == END: - self.throwNotification("start") - self.throwActuation("downFlippers") - self.throwActuation("closeMouth") - self.throwNotification("stop") - self.stopTTS() self.stop() |
From: jerome <c2m...@c2...> - 2010-01-05 09:15:16
|
Author: jerome Date: 2010-01-05 10:14:59 +0100 (Tue, 05 Jan 2010) New Revision: 6030 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Added K_HANGUP rc button to reject a call. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 08:23:04 UTC (rev 6029) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2010-01-05 09:14:59 UTC (rev 6030) @@ -195,53 +195,44 @@ def onPluginEvent(self, eventName, eventValues): '''Callback on plugin event. ''' + #Start the adequate function for each plugin command. if not self.getCommand() == 'run': return - - if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL", "K_HANGUP"] ): - #If no commands defined, then quit plugin. + + if self.command == "": + self.client.notify(END) - if self.command == "": - self.client.notify(END) - - #Incoming call head button - if self.command == COMMAND_INCOMING: - if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL"] ): - self.client.notify(ACCEPT_INCOMING) - self.command = WAIT_END_CALL - self.stopTTS() - elif self.command == WAIT_END_CALL: - if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_HANGUP"] ): - self.client.notify(CLOSE_CALL) - - #Outgoing call head button - elif self.command == COMMAND_OUTGOING_USER: - if eventValues[0] != "K_HANGUP": - self.client.notify(CALL_CONTACT) - self.command = WAIT_END_CALL - self.stopTTS() - self.throwNotification("start") - self.throwActuation("openMouth") - self.throwActuation("upFlippers") - self.throwNotification("stop") - - elif ( eventName == 'left' ) or ( eventValues[0] == "K_LEFT" ): - #Incoming call left flipper - if self.command == COMMAND_INCOMING: + #Incoming call head button + if self.command == COMMAND_INCOMING: + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL"] ): + self.client.notify(ACCEPT_INCOMING) + self.command = WAIT_END_CALL + self.stopTTS() + elif (eventName in ["left", "right"]) or ( eventValues[0] in ["K_LEFT", "K_RIGHT", "K_HANGUP"] ): self.client.notify(REJECT_INCOMING) - - #Outgoing call left flipper - elif self.command == COMMAND_OUTGOING_USER: - self.client.notify(NEXT_CONTACT) - elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ): - #Incoming call right fliper - if self.command == COMMAND_INCOMING: - self.client.notify(REJECT_INCOMING) - - #Outgoing call right fliper. - elif self.command == COMMAND_OUTGOING_USER: + elif self.command == WAIT_END_CALL: + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_HANGUP"] ): + self.client.notify(CLOSE_CALL) + + #Outgoing call head button + elif self.command == COMMAND_OUTGOING_USER: + if ( eventName == 'head' ) or( eventValues[0] in ["K_OK", "K_RECEIVECALL"] ): + self.client.notify(CALL_CONTACT) + self.command = WAIT_END_CALL + self.stopTTS() + self.throwNotification("start") + self.throwActuation("openMouth") + self.throwActuation("upFlippers") + self.throwNotification("stop") + + elif ( eventName == 'left' ) or ( eventValues[0] == "K_LEFT"): + #Outgoing call left flipper + self.client.notify(NEXT_CONTACT) + + elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ): + #Outgoing call right fliper. self.client.notify(PREVIOUS_CONTACT) |
From: jerome <c2m...@c2...> - 2010-01-05 08:23:27
|
Author: jerome Date: 2010-01-05 09:23:04 +0100 (Tue, 05 Jan 2010) New Revision: 6029 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py Log: * Fixed the way to check for skype client process ( there have some problems with previous function on win xp ). Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2010-01-04 10:03:31 UTC (rev 6028) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2010-01-05 08:23:04 UTC (rev 6029) @@ -23,7 +23,8 @@ import os import threading import commands -import subprocess +import subprocess +from ctypes import windll from string import find from time import sleep from threading import Thread @@ -78,20 +79,9 @@ def __is_running_windows__(self): '''Check for Skype client process. ''' - try: - from win32com.client import GetObject - import pythoncom - pythoncom.CoInitialize() - WMI = GetObject('winmgmts:\\') - processes = WMI.InstancesOf('Win32_Process') - for process in processes: - if process.name in ['skype.exe', 'Skype.exe']: - return True - pythoncom.CoUninitialize() - return False - except Exception, e: - pythoncom.CoUninitialize() - return False + # TZap is for Skype 4.0, tSk for 3.8 series + return bool(windll.user32.FindWindowA('TZapMainForm.UnicodeClass', None) or \ + windll.user32.FindWindowA('tSkMainForm.UnicodeClass', None)) # -------------------------------------------------------------------------- # Start skype on linux. |
From: jerome <c2m...@c2...> - 2010-01-04 10:03:40
|
Author: jerome Date: 2010-01-04 11:03:31 +0100 (Mon, 04 Jan 2010) New Revision: 6028 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/fr.po software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot Log: * Fixed a message id. * Updated french sentenses. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/fr.po =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/fr.po 2010-01-04 09:11:55 UTC (rev 6027) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/fr.po 2010-01-04 10:03:31 UTC (rev 6028) @@ -1,14 +1,3 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - msgid "Facebook Plugin" msgstr "Plugin Facebook" @@ -67,34 +56,143 @@ msgstr "Votre nouveau statut a été publié" msgid "An error occured trying to set your new status, please, allow me to access your wall" -msgstr "Une erreur est survenue en essayant de mettre à jour votre nouveau statut." +msgstr "Une erreur est survenue en essayant de mettre à jour votre nouveau statut." + +msgid "You don't have any messages" +msgstr "Vous n'avez pas de messages" + +msgid "I couldn't find any new messages" +msgstr "Je ne trouve aucun nouveaux messages" + +msgid "There are no new private messages detected" +msgstr "Aucun nouveaux messages privés détectés" + +msgid "No private messages detected" +msgstr "Pas de messages privés détéctés" + +msgid "{0} requests to be your friend" +msgstr "{0} souhaite être votre ami" + +msgid "{0} asks to be your friend" +msgstr "{0} demande d'être ami avec vous" + +msgid "{0} wants to have you as a friend" +msgstr "{0} souhaite vous avoir comme ami" + +msgid "{0} wants to add you to his friend list" +msgstr "{0} souhaite vous ajouter à sa liste d'amis" + +msgid "You don't have any friend requests" +msgstr "Vous n'avez aucune demande d'amis" + +msgid "I didn't find any friend requests" +msgstr "Je n'ai trouvé aucune demande d'ami" + +msgid "There are no new friend requests" +msgstr "Il n'y a aucune nouvelle demande d'ami" + +msgid "No one asked to be your friend" +msgstr "Personne n'a demandé à être votre ami" + +msgid "You are invited to this group: {0}" +msgstr "Vous êtes invité à ce groupe: {0}" + +msgid "You received an invitation for the following group: {0}" +msgstr "Vous avez reçu une invitation pour le groupe suivant: {0}" + +msgid "You got a group invitation for: {0}" +msgstr "Vous avez une invitation de groupe pour: {0}" + +msgid "You received an invite for the group: {0}" +msgstr "Vous avez reçu une invitation pour le groupe: {0}" + +msgid "I have received a group invite for: {0}" +msgstr "J'ai reçu une invitation de groupe pour: {0}" + +msgid "You don't have any group invites" +msgstr "Vous n'avez aucune invitation de groupe" + +msgid "I didn't find any group invites" +msgstr "Je ne peux trouver aucune invitation de groupe" + +msgid "There are no new group invites" +msgstr "Il n'y a aucune nouvelle invitation de groupe" + +msgid "You didn't receive new group invites" +msgstr "Vous n'avez reçu aucune nouvelle invitation de groupe" + +msgid "You are not invited to any new groups" +msgstr "Vous n'êtes invité à aucun groupe" + +msgid "You are invited to the event: {0}" +msgstr "Vous êtes invité à l'évènement: {0}" + +msgid "You received an invitation to the following event: {0}" +msgstr "Vous avez reçu une invitation pour l'évènement suivant: {0}" + +msgid "I found an event invite from: {0}" +msgstr "J'ai trouvé une invitation pour l'évènement: {0}" + +msgid "You are invited to an event: {0}" +msgstr "Vous êtes invité à un évènement: {0}" + +msgid "I detected a new event invite from: {0}" +msgstr "J'ai détecté une nouvelle invitation à l'évènement: {0}" + +msgid "You don't have any event invites" +msgstr "Vous n'avez aucune invitation à l'évènement: {0}" + +msgid "I didn't find any event invites" +msgstr "Je n'ai trouvé aucune invitation à un évènement" + +msgid "You didn't receive any new event invites" +msgstr "Vous n'avez reçu aucune nouvelle invitation à un évènement" + +msgid "You have no new group invites" +msgstr "Vous n'avez pas d'invitation de groupe" + +msgid "There are no new group invites available" +msgstr "Il n'y a aucune invitation de groupe disponible" + +msgid "You do not seem to be connected. Please, verify your user name and password, then try again." +msgstr "Vous ne semblez pas être connecté. S'il vous plait, vérifiez votre login et votre mot de passe." + +msgid "I am not able to connect. Please, check your user name and password in the gadget configuration." +msgstr "Je ne suis pas en mesure de me connecter à votre compte. S'il vous plait, vérifiez votre configuration." + +msgid "I could not connect to Facebook. Check your user name and password and try again." +msgstr "Je ne peux me connecter à Facebook. Vérifiez votre nom d'utilisateur et votre mot de passe." + +msgid "I got an error when connecting to your Facebook. Please, verify your user name and password in the gadget configuration." +msgstr "J'ai rencontré une erreur en me connectant à Facebook. Vérifiez votre nom d'utilisateur et votre mot de passe dans la configuration du gadget." + +msgid "You have a new message" +msgstr "Vous avez un nouveau message." + +msgid "You received one new message" +msgstr "Vous avez reçu un nouveau message." + +msgid "I detected a new message" +msgstr "J'ai détecté un nouveau message." + +msgid "You received only one message" +msgstr "Vous n'avez reçu qu'un seul message." + +msgid "I found a new message on your Facebook account" +msgstr "J'ai trouvé un nouveau message sur votre compte Facebook." + +msgid "You have {0} messages" +msgstr "Vous avez {0} messages." + +msgid "You received {0} new messages" +msgstr "Vous avez reçu {0} nouveaux messages." + +msgid "I detected {0} new messages on your Facebook account" +msgstr "J'ai détecté {0} nouveaux messages sur votre compte Facebook." + +msgid "There are {0} new messages available" +msgstr "Il y a {0} nouveaux messages disponibles." + +msgid "You received {0} private messages" +msgstr "Vous avez reçu {0} messages privés." -msgid "You don't have any messages" -msgstr "Vous n'avez pas de nouveaux messages" - -msgid "{0} requests to be your friend" -msgstr "{0} vous demande d'être son ami" - -msgid "You don't have any friend requests" -msgstr "Vous n'avez aucune demande d'amis" - -msgid "You are invited to this group: {0}" -msgstr "Vous êtes invité à vous joindre au groupe: {0}" - -msgid "You don't have any group invites" -msgstr "Vous n'avez aucune invitation de groupe" - -msgid "You are invited to the event: {0}" -msgstr "Vous êtes invité à l'évènement: {0}" - -msgid "You don't have any event invites" -msgstr "Vous n'êtes invité à aucun évènement" - -msgid "You do not seem to be connected. Please, verify you username and password, then try again." -msgstr "Il semble que vous ne soyez pas connecté. Vérifiez votre login et votre mot de passe et essayez à nouveau." - -msgid "You have a new message" -msgstr "Vous avez un nouveau message" - -msgid "You have {0} messages" -msgstr "Vous avez {0} nouveaux messages" Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot 2010-01-04 09:11:55 UTC (rev 6027) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot 2010-01-04 10:03:31 UTC (rev 6028) @@ -103,7 +103,7 @@ msgid "You got a group invitation for: {0}" msgstr "" -msgid "You received and invite for the group: {0}" +msgid "You received an invite for the group: {0}" msgstr "" msgid "I have received a group invite for: {0}" |
From: jerome <c2m...@c2...> - 2010-01-04 09:12:17
|
Author: jerome Date: 2010-01-04 10:11:55 +0100 (Mon, 04 Jan 2010) New Revision: 6027 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot Log: * Fixed pot file. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot 2009-12-31 13:23:19 UTC (rev 6026) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/plugin.pot 2010-01-04 09:11:55 UTC (rev 6027) @@ -1,89 +1,198 @@ -msgid "Facebook Plugin" +msgid "Facebook Plugin" +msgstr "" + +msgid "The Facebook plugin will notify you of any updates on your Facebook account." +msgstr "" + +msgid "Login" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Check number of messages" +msgstr "" + +msgid "Check friend requests" +msgstr "" + +msgid "Check group invites" +msgstr "" + +msgid "Check event invites" +msgstr "" + +msgid "Update user status" +msgstr "" + +msgid "Feed to add" +msgstr "" + +msgid "Hello all from my Tux Droid Facebook gadget" +msgstr "" + +msgid "Run to check your Facebook account" +msgstr "" + +msgid "Check your Facebook account" +msgstr "" + +msgid "Configure Tux Droid Facebook permissions" +msgstr "" + +msgid "Start every x" +msgstr "" + +msgid "Start me every x" +msgstr "" + +msgid "Please, allow me to access your Facebook account" +msgstr "" + +msgid "I cannot get connected to your facebook account." +msgstr "" + +msgid "Your new status was published" +msgstr "" + +msgid "An error occured trying to set your new status, please, allow me to access your wall" +msgstr "" + +msgid "You don't have any messages" +msgstr "" + +msgid "I couldn't find any new messages" +msgstr "" + +msgid "There are no new private messages detected" +msgstr "" + +msgid "No private messages detected" +msgstr "" + +msgid "{0} requests to be your friend" +msgstr "" + +msgid "{0} asks to be your friend" +msgstr "" + +msgid "{0} wants to have you as a friend" +msgstr "" + +msgid "{0} wants to add you to his friend list" +msgstr "" + +msgid "You don't have any friend requests" +msgstr "" + +msgid "I didn't find any friend requests" +msgstr "" + +msgid "There are no new friend requests" +msgstr "" + +msgid "No one asked to be your friend" +msgstr "" + +msgid "You are invited to this group: {0}" +msgstr "" + +msgid "You received an invitation for the following group: {0}" +msgstr "" + +msgid "You got a group invitation for: {0}" +msgstr "" + +msgid "You received and invite for the group: {0}" +msgstr "" + +msgid "I have received a group invite for: {0}" +msgstr "" + +msgid "You don't have any group invites" +msgstr "" + +msgid "I didn't find any group invites" +msgstr "" + +msgid "There are no new group invites" +msgstr "" + +msgid "You didn't receive new group invites" +msgstr "" + +msgid "You are not invited to any new groups" +msgstr "" + +msgid "You are invited to the event: {0}" +msgstr "" + +msgid "You received an invitation to the following event: {0}" +msgstr "" + +msgid "I found an event invite from: {0}" +msgstr "" + +msgid "You are invited to an event: {0}" +msgstr "" + +msgid "I detected a new event invite from: {0}" +msgstr "" + +msgid "You don't have any event invites" +msgstr "" + +msgid "I didn't find any event invites" +msgstr "" + +msgid "You didn't receive any new event invites" +msgstr "" + +msgid "You have no new group invites" +msgstr "" + +msgid "There are no new group invites available" +msgstr "" + +msgid "You do not seem to be connected. Please, verify your user name and password, then try again." +msgstr "" + +msgid "I am not able to connect. Please, check your user name and password in the gadget configuration." +msgstr "" + +msgid "I could not connect to Facebook. Check your user name and password and try again." +msgstr "" + +msgid "I got an error when connecting to your Facebook. Please, verify your user name and password in the gadget configuration." +msgstr "" + +msgid "You have a new message" +msgstr "" + +msgid "You received one new message" +msgstr "" + +msgid "I detected a new message" +msgstr "" + +msgid "You received only one message" +msgstr "" + +msgid "I found a new message on your Facebook account" +msgstr "" + +msgid "You have {0} messages" +msgstr "" + +msgid "You received {0} new messages" +msgstr "" + +msgid "I detected {0} new messages on your Facebook account" +msgstr "" + +msgid "There are {0} new messages available" +msgstr "" + +msgid "You received {0} private messages" msgstr "" -msgid "The Facebook plugin will notify you of any updates on your Facebook account." -msgstr "" - -msgid "Login" -msgstr "" - -msgid "Password" -msgstr "" - -msgid "Check number of messages" -msgstr "" - -msgid "Check friend requests" -msgstr "" - -msgid "Check group invites" -msgstr "" - -msgid "Check event invites" -msgstr "" - -msgid "Update user status" -msgstr "" - -msgid "Feed to add" -msgstr "" - -msgid "Hello all from my Tux Droid Facebook gadget" -msgstr "" - -msgid "Run to check your Facebook account" -msgstr "" - -msgid "Check your Facebook account" -msgstr "" - -msgid "Configure Tux Droid Facebook permissions" -msgstr "" - -msgid "Start every x" -msgstr "" - -msgid "Start me every x" -msgstr "" - -msgid "Please, allow me to access your Facebook account" -msgstr "" - -msgid "I cannot get connected to your facebook account." -msgstr "" - -msgid "Your new status was published" -msgstr "" - -msgid "An error occured trying to set your new status, please, allow me to access your wall" -msgstr "" - -msgid "You don't have any messages" -msgstr "" - -msgid "{0} requests to be your friend" -msgstr "" - -msgid "You don't have any friend requests" -msgstr "" - -msgid "You are invited to this group: {0}" -msgstr "" - -msgid "You don't have any group invites" -msgstr "" - -msgid "You are invited to the event: {0}" -msgstr "" - -msgid "You don't have any event invites" -msgstr "" - -msgid "You do not seem to be connected. Please, verify you username and password, then try again." -msgstr "" - -msgid "You have a new message" -msgstr "" - -msgid "You have {0} messages" -msgstr "" |
From: jerome <c2m...@c2...> - 2009-12-31 13:23:45
|
Author: jerome Date: 2009-12-31 14:23:19 +0100 (Thu, 31 Dec 2009) New Revision: 6026 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py Log: * Fixed a memory leak. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-30 18:32:30 UTC (rev 6025) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-31 13:23:19 UTC (rev 6026) @@ -154,14 +154,16 @@ self.__startedMutex.release() self.__onSkypeClosed__() else: - self.__startedMutex.acquire() + if not self.__started: #Skype started event. + self.__startedMutex.acquire() + self.__started = True + self.__startedMutex.release() if self.OnSkypeStarted != None: thread = threading.Thread(target=self.OnSkypeStarted) thread.start() - self.__started = True - self.__startedMutex.release() + # -------------------------------------------------------------------------- # Skype api Event handler, notify of new available API status. @@ -303,5 +305,5 @@ def AttachAPI(self): '''Attach Skype api. ''' - self.__connect_all__() + self.__connect_api__() Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 18:32:30 UTC (rev 6025) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-31 13:23:19 UTC (rev 6026) @@ -102,6 +102,9 @@ #plugin uuid uuid = "8349ed52-572d-4c3f-a7b8-f6d4a5ae2c0" + client = None + serv = None + port = 270 #Skype client - api objects. synchronious = None @@ -109,6 +112,7 @@ connectorObj = None mutex = threading.Lock() + startMutex = threading.Lock() #Used for run command only. command = "" @@ -191,7 +195,6 @@ def onPluginEvent(self, eventName, eventValues): '''Callback on plugin event. ''' - self.throwTrace(eventValues[0]) #Start the adequate function for each plugin command. if not self.getCommand() == 'run': return @@ -363,7 +366,7 @@ ''' Skype closure detected. ''' - if self.serv.hasClient(): + if ( self.serv != None ) and self.serv.hasClient(): self.serv.notify(END) @@ -371,19 +374,23 @@ ''' Skyped started event. ''' - self.throwTrace("skype was started") - mutex = threading.Lock() + if self.startMutex.locked(): + return + + self.startMutex.acquire() self.initialized = False while not self.initialized: - if self.command is None: + if ( self.command is None ) or ( not self.connectorObj.isClientRunning() ): self.command = "" + if self.startMutex.locked(): + self.startMutex.release() break - - mutex.acquire() - time.sleep(4) + + time.sleep(3.0) self.connectorObj.OnAPIReady = self.initializeDaemon self.connectorObj.AttachAPI() - mutex.release() + if self.startMutex.locked(): + self.startMutex.release() Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-30 18:32:30 UTC (rev 6025) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-31 13:23:19 UTC (rev 6026) @@ -250,7 +250,7 @@ #Excetute attached function while stop is not call. if ( self.targetFunct != None ): self.targetFunct() - sleep(1.0) + sleep(1.5) else: break |
From: jerome <c2m...@c2...> - 2009-12-30 18:32:41
|
Author: jerome Date: 2009-12-30 19:32:30 +0100 (Wed, 30 Dec 2009) New Revision: 6025 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Forget to add remote control buttons. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:39:30 UTC (rev 6024) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 18:32:30 UTC (rev 6025) @@ -191,11 +191,12 @@ def onPluginEvent(self, eventName, eventValues): '''Callback on plugin event. ''' + self.throwTrace(eventValues[0]) #Start the adequate function for each plugin command. if not self.getCommand() == 'run': return - if eventName == 'head': + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL", "K_HANGUP"] ): #If no commands defined, then quit plugin. if self.command == "": @@ -203,23 +204,26 @@ #Incoming call head button if self.command == COMMAND_INCOMING: - self.client.notify(ACCEPT_INCOMING) - self.command = WAIT_END_CALL - self.stopTTS() + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL"] ): + self.client.notify(ACCEPT_INCOMING) + self.command = WAIT_END_CALL + self.stopTTS() elif self.command == WAIT_END_CALL: - self.client.notify(CLOSE_CALL) + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_HANGUP"] ): + self.client.notify(CLOSE_CALL) #Outgoing call head button elif self.command == COMMAND_OUTGOING_USER: - self.client.notify(CALL_CONTACT) - self.command = WAIT_END_CALL - self.stopTTS() - self.throwNotification("start") - self.throwActuation("openMouth") - self.throwActuation("upFlippers") - self.throwNotification("stop") + if eventValues[0] != "K_HANGUP": + self.client.notify(CALL_CONTACT) + self.command = WAIT_END_CALL + self.stopTTS() + self.throwNotification("start") + self.throwActuation("openMouth") + self.throwActuation("upFlippers") + self.throwNotification("stop") - elif eventName == 'left': + elif ( eventName == 'left' ) or ( eventValues[0] == "K_LEFT" ): #Incoming call left flipper if self.command == COMMAND_INCOMING: self.client.notify(REJECT_INCOMING) @@ -228,7 +232,7 @@ elif self.command == COMMAND_OUTGOING_USER: self.client.notify(NEXT_CONTACT) - elif eventName == 'right': + elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ): #Incoming call right fliper if self.command == COMMAND_INCOMING: self.client.notify(REJECT_INCOMING) |
From: jerome <c2m...@c2...> - 2009-12-30 13:55:04
|
Author: jerome Date: 2009-12-30 14:39:30 +0100 (Wed, 30 Dec 2009) New Revision: 6024 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py Log: * Updated sleep delays. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:23:19 UTC (rev 6023) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:39:30 UTC (rev 6024) @@ -548,7 +548,7 @@ Run main loop. ''' while 1: - time.sleep(1.0) + time.sleep(2.0) ##---------------------------------------------------------------- Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-30 13:23:19 UTC (rev 6023) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-30 13:39:30 UTC (rev 6024) @@ -250,7 +250,7 @@ #Excetute attached function while stop is not call. if ( self.targetFunct != None ): self.targetFunct() - sleep(0.1) + sleep(1.0) else: break |
From: jerome <c2m...@c2...> - 2009-12-30 13:30:00
|
Author: jerome Date: 2009-12-30 13:13:33 +0100 (Wed, 30 Dec 2009) New Revision: 6021 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po Log: * Updated fr po file. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po 2009-12-30 12:11:33 UTC (rev 6020) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po 2009-12-30 12:13:33 UTC (rev 6021) @@ -35,8 +35,8 @@ msgstr "Quitter le gadget" msgid "Please, login to your Skype account or push my head button to quit gadget" -msgstr "" +msgstr "S'il vou plait, connectez vous à votre compte Skype ou appyez sur mon bouton de tête pour quitter le gadget" msgid "There had a problem with Skype Client, please, try later again." -msgstr "" +msgstr "Il y a eu un problème avec le client Skype, s'il vous plait, essayez plus tard." |
From: jerome <c2m...@c2...> - 2009-12-30 13:23:39
|
Author: jerome Date: 2009-12-30 14:23:19 +0100 (Wed, 30 Dec 2009) New Revision: 6023 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Re-attach api if Skype is closed and started. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:12:47 UTC (rev 6022) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:23:19 UTC (rev 6023) @@ -302,6 +302,7 @@ #Initialize skype client and api objects. self.connectorObj = connector.Connector() self.connectorObj.OnAPIReady = self.initializeDaemon + self.connectorObj.OnSkypeStarted = self.OnSkypeStarted self.connectorObj.OnSkypeClosed = self.OnSkypeClosed #Daemon mode, so we don't start skype automatically. self.connectorObj.start(StartSkype=False) @@ -360,6 +361,25 @@ ''' if self.serv.hasClient(): self.serv.notify(END) + + + def OnSkypeStarted(self): + ''' + Skyped started event. + ''' + self.throwTrace("skype was started") + mutex = threading.Lock() + self.initialized = False + while not self.initialized: + if self.command is None: + self.command = "" + break + + mutex.acquire() + time.sleep(4) + self.connectorObj.OnAPIReady = self.initializeDaemon + self.connectorObj.AttachAPI() + mutex.release() @@ -549,23 +569,8 @@ thread = threading.Thread(target=self.connectorObj.startClient) thread.start() - #Wait for login and attach. - mutex = threading.Lock() - say = True - self.initialized = False - while not self.initialized: - if self.command is None: - self.command = "" - break - - mutex.acquire() - if say: - say = False - self.serv.notify(COMMAND_TTS + "Please, login to your Skype account or push my head button to quit gadget") - time.sleep(4) - self.connectorObj.OnAPIReady = self.initializeDaemon - self.connectorObj.AttachAPI() - mutex.release() + self.serv.notify(COMMAND_TTS + "Please, login to your Skype account or push my head button to quit gadget") + self.OnSkypeStarted() if self.initialized: #Then interface outgoing call. |
From: jerome <c2m...@c2...> - 2009-12-30 13:20:03
|
Author: jerome Date: 2009-12-30 14:12:47 +0100 (Wed, 30 Dec 2009) New Revision: 6022 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py Log: * Added SkypeStarted callback Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-30 12:13:33 UTC (rev 6021) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-30 13:12:47 UTC (rev 6022) @@ -38,7 +38,8 @@ #-------------------- # Public objects #-------------------- - + #Event sent when skype starts. + OnSkypeStarted = None #Event sent if Skype client was closed. OnSkypeClosed = None #API ready event. @@ -59,7 +60,9 @@ apiReady = False #Skype client object. skypeClient = None - #Skype client Loop thread. + #Skype client Loop thread. + __started = False + __startedMutex = threading.Lock() __clientLoop__ = None # ========================================================================== @@ -145,8 +148,20 @@ '''Check for skype client running(used with ExtendedThread object). ''' #Check if skype is closed. - if not self.skypeClient.isRunning(): - self.__onSkypeClosed__() + if not self.skypeClient.isRunning(): + self.__startedMutex.acquire() + self.__started = False + self.__startedMutex.release() + self.__onSkypeClosed__() + else: + self.__startedMutex.acquire() + if not self.__started: + #Skype started event. + if self.OnSkypeStarted != None: + thread = threading.Thread(target=self.OnSkypeStarted) + thread.start() + self.__started = True + self.__startedMutex.release() # -------------------------------------------------------------------------- # Skype api Event handler, notify of new available API status. |
From: jerome <c2m...@c2...> - 2009-12-30 12:12:02
|
Author: jerome Date: 2009-12-30 13:11:33 +0100 (Wed, 30 Dec 2009) New Revision: 6020 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Added a method to quit outgoing gadget if user has closed his Skype client. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 15:01:21 UTC (rev 6019) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 12:11:33 UTC (rev 6020) @@ -302,6 +302,7 @@ #Initialize skype client and api objects. self.connectorObj = connector.Connector() self.connectorObj.OnAPIReady = self.initializeDaemon + self.connectorObj.OnSkypeClosed = self.OnSkypeClosed #Daemon mode, so we don't start skype automatically. self.connectorObj.start(StartSkype=False) @@ -351,6 +352,14 @@ self.initialized = True self.mutex.release() + + + def OnSkypeClosed(self): + ''' + Skype closure detected. + ''' + if self.serv.hasClient(): + self.serv.notify(END) |
From: jerome <c2m...@c2...> - 2009-12-29 15:01:32
|
Author: jerome Date: 2009-12-29 16:01:21 +0100 (Tue, 29 Dec 2009) New Revision: 6019 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Removed debug messages. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 15:00:18 UTC (rev 6018) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 15:01:21 UTC (rev 6019) @@ -178,9 +178,7 @@ ''' self.client = IPNClient('127.0.0.1', 48536) self.client.registerOnNotificationCallBack(self.ClientOnNotification) - started = self.client.start() - self.throwTrace(started) - self.throwTrace("run function passed") + self.client.start() def stopTTS(self): |
From: jerome <c2m...@c2...> - 2009-12-29 15:00:43
|
Author: jerome Date: 2009-12-29 16:00:18 +0100 (Tue, 29 Dec 2009) New Revision: 6018 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/de.po software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/en.po software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/nl.po software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/plugin.pot Log: * Added a method to qui skype plugin and client when user is not near his PC, so not able to connect. * Added some strings. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 15:00:18 UTC (rev 6018) @@ -111,7 +111,7 @@ mutex = threading.Lock() #Used for run command only. - command = None + command = "" canrun = True #Used for outgoing parameter only. @@ -130,6 +130,7 @@ def start(self): '''Plugin entry point. ''' + self.getCommand() self.checkSkype() #Init port. self.port = TuxDroidServerUtils.getServerPort() @@ -177,7 +178,9 @@ ''' self.client = IPNClient('127.0.0.1', 48536) self.client.registerOnNotificationCallBack(self.ClientOnNotification) - self.client.start() + started = self.client.start() + self.throwTrace(started) + self.throwTrace("run function passed") def stopTTS(self): @@ -197,7 +200,7 @@ if eventName == 'head': #If no commands defined, then quit plugin. - if self.command is None: + if self.command == "": self.client.notify(END) #Incoming call head button @@ -341,6 +344,13 @@ self.asynchronious.OnOutgoingCall = self.OnOutgoingCall self.asynchronious.OnOutgoingFinished = self.OnOutgoingFinished + #Setting Tux Droid as audio peripheral. + try: + if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): + self.synchronious.setAudioCards() + except: + pass + self.initialized = True self.mutex.release() @@ -512,16 +522,6 @@ ''' while 1: time.sleep(1.0) - - #Setting Tux Droid as audio peripheral. - - try: - #in try statement to take calls in care. - if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): - self.throwTrace(self.synchronious.setAudioCards()) - except: - pass - ##---------------------------------------------------------------- @@ -531,7 +531,6 @@ ''' Server IPN callback when IPN client is added. ''' - #First action, sending command to the plugin client. if self.isIncoming: #Then it's an incoming call. @@ -539,21 +538,31 @@ elif self.isOutgoingUser: if not self.connectorObj.isClientRunning(): + self.clientStartedByPlugin = True thread = threading.Thread(target=self.connectorObj.startClient) thread.start() - self.clientStartedByPlugin = True + #Wait for login and attach. mutex = threading.Lock() + say = True self.initialized = False while not self.initialized: + if self.command is None: + self.command = "" + break + mutex.acquire() + if say: + say = False + self.serv.notify(COMMAND_TTS + "Please, login to your Skype account or push my head button to quit gadget") time.sleep(4) self.connectorObj.OnAPIReady = self.initializeDaemon self.connectorObj.AttachAPI() mutex.release() - #Then interface outgoing call. - self.serv.notify(COMMAND_OUTGOING_USER) + if self.initialized: + #Then interface outgoing call. + self.serv.notify(COMMAND_OUTGOING_USER) else: #Then user uses TuxBox to make a call. @@ -622,8 +631,22 @@ #Global close request from client. elif Message == END: + #Command aborded. + self.command = None self.serv.notify(END) + #Reset values. + self.isIncoming = False + self.isOutgoingUser = True + #Quit Skype client if started bu outgoing plugin. + try: + if self.clientStartedByPlugin: + self.connectorObj.stopClient() + self.clientStartedByPlugin = False + except: + pass + + if __name__ == "__main__": plugin = SkypePlugin() Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/de.po =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/de.po 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/de.po 2009-12-29 15:00:18 UTC (rev 6018) @@ -33,3 +33,9 @@ msgid "Quit gadget" msgstr "Beenden die Kadchet." +msgid "Please, login to your Skype account or push my head button to quit gadget" +msgstr "" + +msgid "There had a problem with Skype Client, please, try later again." +msgstr "" + Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/en.po =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/en.po 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/en.po 2009-12-29 15:00:18 UTC (rev 6018) @@ -33,3 +33,10 @@ msgid "Quit gadget" msgstr "Quit gadget" + +msgid "Please, login to your Skype account or push my head button to quit gadget" +msgstr "Please, login to your Skype account or push my head button to quit gadget" + +msgid "There had a problem with Skype Client, please, try later again." +msgstr "There had a problem with Skype Client, please, try later again." + Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/fr.po 2009-12-29 15:00:18 UTC (rev 6018) @@ -33,3 +33,10 @@ msgid "Quit gadget" msgstr "Quitter le gadget" + +msgid "Please, login to your Skype account or push my head button to quit gadget" +msgstr "" + +msgid "There had a problem with Skype Client, please, try later again." +msgstr "" + Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/nl.po =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/nl.po 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/nl.po 2009-12-29 15:00:18 UTC (rev 6018) @@ -32,4 +32,10 @@ msgstr "Sorry, maar skype is niet geïnstalleerd. Gelieve naar de skype website te gaan en de software te installeren." msgid "Quit gadget" -msgstr "Gadget afsluiten" +msgstr "Gadget afsluiten" + +msgid "Please, login to your Skype account or push my head button to quit gadget" +msgstr "" + +msgid "There had a problem with Skype Client, please, try later again." +msgstr "" Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/plugin.pot =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/plugin.pot 2009-12-29 10:21:03 UTC (rev 6017) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/resources/plugin.pot 2009-12-29 15:00:18 UTC (rev 6018) @@ -32,4 +32,10 @@ msgstr "" msgid "Quit gadget" +msgstr "" + +msgid "Please, login to your Skype account or push my head button to quit gadget" +msgstr "" + +msgid "There had a problem with Skype Client, please, try later again." msgstr "" |
From: jerome <c2m...@c2...> - 2009-12-29 10:21:18
|
Author: jerome Date: 2009-12-29 11:21:03 +0100 (Tue, 29 Dec 2009) New Revision: 6017 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Fixed a bug making outgoing calls when Skype client were never started. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-28 09:52:05 UTC (rev 6016) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-29 10:21:03 UTC (rev 6017) @@ -154,13 +154,13 @@ def __new_skype_status__(self, status): '''If Skype is closed and reopened we can reattach. ''' + self.skype.OnAttachmentStatus = self.__new_skype_status__ #If api is not attached, then setting 'api not ready' values if status != Skype4Py.apiAttachSuccess: self.apiReady = False #API attach is available, meaning api was disconnected. if status == Skype4Py.apiAttachAvailable: - self.skype.OnAttachmentStatus = self.__new_skype_status__ #Attaching api. try: self.skype.Attach() @@ -279,4 +279,14 @@ ''' if(self.lock): self.lock = False - return not self.lock + return not self.lock + + + # -------------------------------------------------------------------------- + # Attach Skype api. + # -------------------------------------------------------------------------- + def AttachAPI(self): + '''Attach Skype api. + ''' + self.__connect_all__() + Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-28 09:52:05 UTC (rev 6016) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-29 10:21:03 UTC (rev 6017) @@ -318,6 +318,7 @@ ''' Initialize Skype objects and set events handlers. ''' + self.mutex.acquire() #Api ready and connected so creatin other commands objects. self.synchronious = SynchroniousCommands(self.connectorObj) @@ -340,9 +341,9 @@ self.asynchronious.OnOutgoingCall = self.OnOutgoingCall self.asynchronious.OnOutgoingFinished = self.OnOutgoingFinished - self.mutex.acquire() self.initialized = True self.mutex.release() + def OnIncomingRefused(self, contactHandle): @@ -513,14 +514,14 @@ time.sleep(1.0) #Setting Tux Droid as audio peripheral. - ''' + try: #in try statement to take calls in care. if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): self.throwTrace(self.synchronious.setAudioCards()) except: pass - ''' + ##---------------------------------------------------------------- @@ -535,25 +536,34 @@ if self.isIncoming: #Then it's an incoming call. self.serv.notify(COMMAND_INCOMING) + elif self.isOutgoingUser: if not self.connectorObj.isClientRunning(): - self.connectorObj.startClient() - while ( not self.initialized ): - time.sleep(2.0) + thread = threading.Thread(target=self.connectorObj.startClient) + thread.start() + self.clientStartedByPlugin = True + #Wait for login and attach. + mutex = threading.Lock() self.initialized = False - self.clientStartedByPlugin = True + while not self.initialized: + mutex.acquire() + time.sleep(4) + self.connectorObj.OnAPIReady = self.initializeDaemon + self.connectorObj.AttachAPI() + mutex.release() + #Then interface outgoing call. self.serv.notify(COMMAND_OUTGOING_USER) + else: #Then user uses TuxBox to make a call. self.serv.notify(COMMAND_OUTGOING_INTERFACE) #Finally, reset values. self.isIncoming = False - self.isOutgoingUser = True + self.isOutgoingUser = True - def ServerOnClientNotification(self, idClient, Message): ''' ''' |
From: jerome <c2m...@c2...> - 2009-12-28 09:52:38
|
Author: jerome Date: 2009-12-28 10:52:05 +0100 (Mon, 28 Dec 2009) New Revision: 6016 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Fixed a bug starting plugin in Linux. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-25 10:42:23 UTC (rev 6015) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-28 09:52:05 UTC (rev 6016) @@ -297,19 +297,18 @@ ''' Run plugin command. ''' - #Creating and starting server. - self.serv = IPNServer('127.0.0.1', 48536) - self.serv.registerOnClientAddedCallBack(self.ServerOnClientAdded) - self.serv.registerOnClientNotificationCallBack(self.ServerOnClientNotification) - self.serv.start() - #Initialize skype client and api objects. self.connectorObj = connector.Connector() self.connectorObj.OnAPIReady = self.initializeDaemon #Daemon mode, so we don't start skype automatically. self.connectorObj.start(StartSkype=False) + self.serv = IPNServer('127.0.0.1', 48536) + self.serv.registerOnClientAddedCallBack(self.ServerOnClientAdded) + self.serv.registerOnClientNotificationCallBack(self.ServerOnClientNotification) + self.serv.start() + #Finally, starting daemon main loop mainl = threading.Thread(target=self.mainloop) mainl.start() @@ -514,13 +513,14 @@ time.sleep(1.0) #Setting Tux Droid as audio peripheral. - + ''' try: #in try statement to take calls in care. if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): self.throwTrace(self.synchronious.setAudioCards()) except: pass + ''' ##---------------------------------------------------------------- @@ -583,18 +583,22 @@ #-------------- Outgoing call commands --------------# elif Message == GET_CONTACTS_LIST: - try: - self.onlineList = self.synchronious.getOnlineList() - except: - self.onlineList = [] - self.onlineList.append("Quit gadget") - time.sleep(0.3) + if self.initialized: + try: + self.onlineList = self.synchronious.getOnlineList() + except: + self.onlineList = [] + + self.onlineList.append("Quit gadget") + time.sleep(0.3) - #at least one user find. - if len(self.onlineList) > 1: - self.currentContact = 0 - self.serv.notify( COMMAND_TTS + self.onlineList[0] ) - + #at least one user find. + if len(self.onlineList) > 1: + self.currentContact = 0 + self.serv.notify( COMMAND_TTS + self.onlineList[0] ) + else: + self.onlineList = ["Quit gadget", ] + self.serv.notify(COMMAND_TTS + "There had a problem with Skype Client, please, try later again.") elif Message == NEXT_CONTACT: thread = threading.Thread(target=self.nextContact) |
From: jerome <c2m...@c2...> - 2009-12-25 10:42:34
|
Author: jerome Date: 2009-12-25 11:42:23 +0100 (Fri, 25 Dec 2009) New Revision: 6015 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/en.po Log: * Added new sentences in the po file. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/en.po =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/en.po 2009-12-25 10:41:27 UTC (rev 6014) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/resources/en.po 2009-12-25 10:42:23 UTC (rev 6015) @@ -1,100 +1,197 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -msgid "Facebook Plugin" -msgstr "Facebook Plugin" - -msgid "The Facebook plugin will notify you of any updates on your Facebook account." -msgstr "The Facebook plugin will notify you of any updates on your Facebook account." - -msgid "Login" -msgstr "Username" - -msgid "Password" -msgstr "Password" - -msgid "Check number of messages" -msgstr "Check number of messages" - -msgid "Check friend requests" -msgstr "Check friend requests" - -msgid "Check group invites" -msgstr "Check group invites" - -msgid "Check event invites" -msgstr "Check event invites" - -msgid "Update user status" -msgstr "Update user status" - -msgid "Feed to add" -msgstr "Feed to add" - -msgid "Hello all from my Tux Droid Facebook gadget" -msgstr "Hello all from my Tux Droid Facebook gadget" - -msgid "Run to check your Facebook account" -msgstr "Run to check your Facebook account" - -msgid "Check your Facebook account" -msgstr "Check your Facebook account" - -msgid "Configure Tux Droid Facebook permissions" -msgstr "Configure Tux Droid Facebook permissions" - -msgid "Start every x" -msgstr "Alerts" - -msgid "Start me every x" -msgstr "Check my Facebook account automatically " - -msgid "Please, allow me to access your Facebook account" -msgstr "Please, allow me to access your Facebook account" - -msgid "I cannot get connected to your facebook account." -msgstr "I cannot get connected to your facebook account." - -msgid "Your new status was published" -msgstr "Your new status was published" - -msgid "An error occured trying to set your new status, please, allow me to access your wall" -msgstr "An error occured trying to set your new status, please, allow me to access your wall" - -msgid "You don't have any messages" -msgstr "You don't have any messages" - -msgid "{0} requests to be your friend" -msgstr "{0} requests to be your friend" - -msgid "You don't have any friend requests" -msgstr "You don't have any friend requests" - -msgid "You are invited to this group: {0}" -msgstr "You are invited to this group: {0}" - -msgid "You don't have any group invites" -msgstr "You don't have any group invites" - -msgid "You are invited to the event: {0}" -msgstr "You are invited to the event: {0}" - -msgid "You don't have any event invites" -msgstr "You don't have any event invites" - -msgid "You do not seem to be connected. Please, verify you username and password, then try again." -msgstr "You do not seem to be connected. Please, verify you username and password, then try again." - -msgid "You have a new message" -msgstr "You have one new message" - -msgid "You have {0} messages" -msgstr "You have {0} messages" +msgid "Facebook Plugin" +msgstr "Facebook Plugin" + +msgid "The Facebook plugin will notify you of any updates on your Facebook account." +msgstr "The Facebook plugin will notify you of any updates on your Facebook account." + +msgid "Login" +msgstr "Username" + +msgid "Password" +msgstr "Password" + +msgid "Check number of messages" +msgstr "Check number of messages" + +msgid "Check friend requests" +msgstr "Check friend requests" + +msgid "Check group invites" +msgstr "Check group invites" + +msgid "Check event invites" +msgstr "Check event invites" + +msgid "Update user status" +msgstr "Update user status" + +msgid "Feed to add" +msgstr "Feed to add" + +msgid "Hello all from my Tux Droid Facebook gadget" +msgstr "Hello all from my Tux Droid Facebook gadget" + +msgid "Run to check your Facebook account" +msgstr "Run to check your Facebook account" + +msgid "Check your Facebook account" +msgstr "Check your Facebook account" + +msgid "Configure Tux Droid Facebook permissions" +msgstr "Configure Tux Droid Facebook permissions" + +msgid "Start every x" +msgstr "Alerts" + +msgid "Start me every x" +msgstr "Check my Facebook account automatically" + +msgid "Please, allow me to access your Facebook account" +msgstr "Please, allow me to access your Facebook account" + +msgid "I cannot get connected to your facebook account." +msgstr "I cannot get connected to your facebook account." + +msgid "Your new status was published" +msgstr "Your new status was published" + +msgid "An error occured trying to set your new status, please, allow me to access your wall" +msgstr "An error occured trying to set your new status, please, allow me to access your wall" + +msgid "You don't have any messages" +msgstr "You don't have any messages" + +msgid "I couldn't find any new messages" +msgstr "I couldn't find any new messages" + +msgid "There are no new private messages detected" +msgstr "There are no new private messages detected" + +msgid "No private messages detected" +msgstr "No private messages detected" + +msgid "{0} requests to be your friend" +msgstr "{0} requests to be your friend" + +msgid "{0} asks to be your friend" +msgstr "{0} asks to be your friend" + +msgid "{0} wants to have you as a friend" +msgstr "{0} wants to have you as a friend" + +msgid "{0} wants to add you to his friend list" +msgstr "{0} wants to add you to his friend list" + +msgid "You don't have any friend requests" +msgstr "You don't have any friend requests" + +msgid "I didn't find any friend requests" +msgstr "I didn't find any friend requests" + +msgid "There are no new friend requests" +msgstr "There are no new friend requests" + +msgid "No one asked to be your friend" +msgstr "No one asked to be your friend" + +msgid "You are invited to this group: {0}" +msgstr "You are invited to this group: {0}" + +msgid "You received an invitation for the following group: {0}" +msgstr "You received an invitation for the following group: {0}" + +msgid "You got a group invitation for: {0}" +msgstr "You got a group invitation for: {0}" + +msgid "You received and invite for the group: {0}" +msgstr "You received and invite for the group: {0}" + +msgid "I have received a group invite for: {0}" +msgstr "I have received a group invite for: {0}" + +msgid "You don't have any group invites" +msgstr "You don't have any group invites" + +msgid "I didn't find any group invites" +msgstr "I didn't find any group invites" + +msgid "There are no new group invites" +msgstr "There are no new group invites" + +msgid "You didn't receive new group invites" +msgstr "You didn't receive new group invites" + +msgid "You are not invited to any new groups" +msgstr "You are not invited to any new groups" + +msgid "You are invited to the event: {0}" +msgstr "You are invited to the event: {0}" + +msgid "You received an invitation to the following event: {0}" +msgstr "You received an invitation to the following event: {0}" + +msgid "I found an event invite from: {0}" +msgstr "I found an event invite from: {0}" + +msgid "You are invited to an event: {0}" +msgstr "You are invited to an event: {0}" + +msgid "I detected a new event invite from: {0}" +msgstr "I detected a new event invite from: {0}" + +msgid "You don't have any event invites" +msgstr "You don't have any event invites" + +msgid "I didn't find any event invites" +msgstr "I didn't find any event invites" + +msgid "You didn't receive any new event invites" +msgstr "You didn't receive any new event invites" + +msgid "You have no new group invites" +msgstr "You have no new group invites" + +msgid "There are no new group invites available" +msgstr "There are no new group invites available" + +msgid "You do not seem to be connected. Please, verify your user name and password, then try again." +msgstr "You do not seem to be connected. Please, verify your user name and password, then try again." + +msgid "I am not able to connect. Please, check your user name and password in the gadget configuration." +msgstr "I am not able to connect. Please, check your user name and password in the gadget configuration." + +msgid "I could not connect to Facebook. Check your user name and password and try again." +msgstr "I could not connect to Facebook. Check your user name and password and try again." + +msgid "I got an error when connecting to your Facebook. Please, verify your user name and password in the gadget configuration." +msgstr "I got an error when connecting to your Facebook. Please, verify your user name and password in the gadget configuration." + +msgid "You have a new message" +msgstr "You have one new message" + +msgid "You received one new message" +msgstr "You received one new message" + +msgid "I detected a new message" +msgstr "I detected a new message" + +msgid "You received only one message" +msgstr "You received only one message" + +msgid "I found a new message on your Facebook account" +msgstr "I found a new message on your Facebook account" + +msgid "You have {0} messages" +msgstr "You have {0} messages" + +msgid "You received {0} new messages" +msgstr "You received {0} new messages" + +msgid "I detected {0} new messages on your Facebook account" +msgstr "I detected {0} new messages on your Facebook account" + +msgid "There are {0} new messages available" +msgstr "There are {0} new messages available" + +msgid "You received {0} private messages" +msgstr "You received {0} private messages" \ No newline at end of file |
From: jerome <c2m...@c2...> - 2009-12-25 10:41:43
|
Author: jerome Date: 2009-12-25 11:41:27 +0100 (Fri, 25 Dec 2009) New Revision: 6014 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java Log: * Finished pick sentence functionality. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-12-24 18:07:15 UTC (rev 6013) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-12-25 10:41:27 UTC (rev 6014) @@ -176,7 +176,7 @@ { if(!this.getCommand().equalsIgnoreCase("check")) { - this.throwMessage("You do not seem to be connected. Please, verify you username and password, then try again."); + this.throwMessage(this.pickSentence(errorConnections)); } System.exit( 0 ); } @@ -284,20 +284,20 @@ if(read == 1) { throwRes(); - this.throwMessage("You have a new message"); + this.throwMessage(this.pickSentence(newSingleMessage)); } else if( read >= 2 ) { throwRes(); //User hasn't red his mailbox. - this.throwMessage("You have {0} messages", read); + this.throwMessage(this.pickSentence(newMultipleMessage), read); } else if( read < 0) { throwRes(); //User has read something, so throwing all messages count. - this.throwMessage("You have {0} new messages", mails); + this.throwMessage(this.pickSentence(newMultipleMessage), mails); } else @@ -305,7 +305,7 @@ //no messages if(!this.getCommand().equalsIgnoreCase("check")) { - this.throwMessage("You don't have any messages"); + this.throwMessage(this.pickSentence(noNewMessage)); } } } @@ -347,7 +347,7 @@ //Only throwing in the second cycle of check command or run. if(this.getCommand().equalsIgnoreCase("run") || secondCycle) { - this.throwMessage("{0} requests to be your friend", request); + this.throwMessage(this.pickSentence(newFriend), request); said = true; } } @@ -356,14 +356,14 @@ if((! this.getCommand().equalsIgnoreCase("check")) && (!said)) { - this.throwMessage("You don't have any friend requests"); + this.throwMessage(this.pickSentence(noNewFriend)); } } else { if (! this.getCommand().equalsIgnoreCase("check")) { - this.throwMessage("You don't have any friend requests"); + this.throwMessage(this.pickSentence(noNewFriend)); } } } @@ -392,7 +392,7 @@ //Only throwing in the second cycle of check command or run. if(this.getCommand().equalsIgnoreCase("run") || secondCycle) { - this.throwMessage("You are invited to this group: {0}", group); + this.throwMessage(this.pickSentence(newGroup), group); said = true; } } @@ -401,14 +401,14 @@ this.facebookHistory.registerStruct(); if ((! this.getCommand().equalsIgnoreCase("check")) && (!said)) { - this.throwMessage("You don't have any group invites"); + this.throwMessage(this.pickSentence(noNewGroup)); } } else { if (! this.getCommand().equalsIgnoreCase("check")) { - this.throwMessage("You don't have any group invites"); + this.throwMessage(this.pickSentence(noNewGroup)); } } } @@ -436,7 +436,7 @@ //Only throwing in the second cycle of check command or run. if(this.getCommand().equalsIgnoreCase("run") || secondCycle) { - this.throwMessage("You are invited to the event: {0}", event); + this.throwMessage(this.pickSentence(newEvent), event); said = true; } } @@ -445,14 +445,14 @@ this.facebookHistory.registerStruct(); if ((! this.getCommand().equalsIgnoreCase("check")) && (!said)) { - this.throwMessage("You don't have any event invites"); + this.throwMessage(this.pickSentence(noNewEvent)); } } else { if (! this.getCommand().equalsIgnoreCase("check")) { - this.throwMessage("You don't have any event invites"); + this.throwMessage(this.pickSentence(noNewEvent)); } } } |
From: jerome <c2m...@c2...> - 2009-12-24 18:07:32
|
Author: jerome Date: 2009-12-24 19:07:15 +0100 (Thu, 24 Dec 2009) New Revision: 6013 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java Log: * Added random sentences. * Added pick sentence function. Merry Christmas to TuxDroid users. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-12-24 17:23:52 UTC (rev 6012) +++ software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-12-24 18:07:15 UTC (rev 6013) @@ -22,6 +22,7 @@ package com.kysoh.plugins.facebook; +import java.util.Random; import java.util.Vector; import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin; @@ -35,13 +36,68 @@ public class FacebookPlugin extends SimplePlugin<PluginFacebookConfiguration>{ private boolean thrown = false; - - private boolean secondCycle = false; private FacebookFunctions functions; private FacebookDatasStruct facebookHistory; + private String[] noNewFriend = {"You don't have any friend requests", + "I didn't find any friend requests", + "There are no new friend requests", + "No one asked to be your friend"}; + + private String[] newFriend = {"{0} requests to be your friend", + "{0} asks to be your friend", + "{0} wants to have you as a friend", + "{0} wants to add you to his friend list"}; + + private String[] noNewMessage = {"You don't have any messages", + "I couldn't find any new messages", + "There are no new private messages detected", + "No private messages detected"}; + + private String[] newSingleMessage = {"You have one new message", + "You received one new message", + "I detected a new message", + "You received only one message", + "I found a new message on your Facebook account"}; + + private String[] newMultipleMessage = {"You have {0} messages", + "You received {0} new messages", + "I detected {0} new messages on your Facebook account", + "There are {0} new messages available", + "You received {0} private messages"}; + + + private String[] errorConnections = {"You do not seem to be connected. Please, verify your user name and password, then try again.", + "I am not able to connect. Please, check your user name and password in the gadget configuration.", + "I could not connect to Facebook. Check your user name and password and try again.", + "I got an error when connecting to your Facebook. Please, verify your user name and password in the gadget configuration."}; + + private String[] noNewEvent = {"You don't have any event invites", + "I didn't find any event invites", + "You didn't receive any new event invites", + "You have no new group invites", + "There are no new group invites available"}; + + private String[] newEvent = {"You are invited to the event: {0}", + "You received an invitation to the following event: {0}", + "I found an event invite from: {0}", + "You are invited to an event: {0}", + "I detected a new event invite from: {0}"}; + + private String[] noNewGroup = {"You don't have any group invites", + "I didn't find any group invites", + "There are no new group invites", + "You didn't receive new group invites", + "You are not invited to any new groups"}; + + private String[] newGroup = {"You are invited to this group: {0}", + "You received an invitation for the following group: {0}", + "You got a group invitation for: {0}", + "You received an invite for the group: {0}", + "I have received a group invite for: {0}"}; + /** * Throws the result in case of Check mode. */ @@ -94,6 +150,16 @@ /** + * This function return a sentences from a defined list + */ + private String pickSentence(String[] list) + { + Random rand = new Random(); + return list[rand.nextInt(list.length)]; + } + + + /** * Start run or check command. */ public void RunOrCheck() |
From: jerome <c2m...@c2...> - 2009-12-24 17:24:12
|
Author: jerome Date: 2009-12-24 18:23:52 +0100 (Thu, 24 Dec 2009) New Revision: 6012 Added: software_suite_v3/software/plugin/plugin-facebook/branches/dynamic_sentences/ Log: * Added a branch to dinamify Facebook sentences. |
From: jerome <c2m...@c2...> - 2009-12-24 14:02:24
|
Author: jerome Date: 2009-12-24 15:01:51 +0100 (Thu, 24 Dec 2009) New Revision: 6011 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py Log: * Fixed audio bug ( Linux ). Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py 2009-12-22 15:23:13 UTC (rev 6010) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py 2009-12-24 14:01:51 UTC (rev 6011) @@ -41,11 +41,6 @@ connectionObj = None currentUser = None - #Audio card values. - IN = 'default' - OUT = 'default' - RINGER = 'default' - #Online status ONLINE = 'ONLINE' AWAY = 'AWAY' @@ -75,10 +70,6 @@ '''Init procedure. ''' self.connectionObj = Connector - #Updating audio cards values. - self.IN = AudioUtils.getSoundDeviceNameTuxdroidMicro() - self.OUT = AudioUtils.getSoundDeviceNameTuxdroidAudio() - self.RINGER = self.OUT #Getting current user. try: self.currentUser = connectionObj.getSkypeAPI().CurrentUser @@ -91,18 +82,19 @@ def __set_tux_in_out__(self): '''Set Tux Droid as audio card for Skype client. ''' - try: - self.connectionObj.getSkypeAPI().Settings.AudioIn = self.IN - self.connectionObj.getSkypeAPI().Settings.AudioOut = self.OUT - self.connectionObj.getSkypeAPI().Settings.Ringer = self.RINGER + try: + #Updating audio cards values. + self.connectionObj.getSkypeAPI().Settings.AudioIn = AudioUtils.getSoundDeviceNameTuxdroidMicro() + self.connectionObj.getSkypeAPI().Settings.AudioOut = AudioUtils.getSoundDeviceNameTuxdroidAudio() + self.connectionObj.getSkypeAPI().Settings.Ringer = AudioUtils.getSoundDeviceNameTuxdroidAudio() time.sleep(1.0) #Checking if Tux Droid was successfully set as audio card. if self.isTuxDroidAudioCard(): return True + return False + except: return False - except: - #Return False, maybe Tux Droid is not connected. - return False + # -------------------------------------------------------------------------- # Return true if Tux Droid is set as audio card. @@ -110,11 +102,11 @@ def __is_tux_audio__(self): '''Return true if Tux Droid is set as audio card. ''' - if not ( self.connectionObj.getSkypeAPI().Settings.AudioIn == self.IN ): + if not ( self.connectionObj.getSkypeAPI().Settings.AudioIn == AudioUtils.getSoundDeviceNameTuxdroidMicro() ): return False - if not ( self.connectionObj.getSkypeAPI().Settings.AudioOut == self.OUT ): + if not ( self.connectionObj.getSkypeAPI().Settings.AudioOut == AudioUtils.getSoundDeviceNameTuxdroidAudio()): return False - if not ( self.connectionObj.getSkypeAPI().Settings.Ringer == self.RINGER ): + if not ( self.connectionObj.getSkypeAPI().Settings.Ringer == AudioUtils.getSoundDeviceNameTuxdroidAudio() ): return False return True Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-22 15:23:13 UTC (rev 6010) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-24 14:01:51 UTC (rev 6011) @@ -35,7 +35,7 @@ import connector from communicator import SynchroniousCommands, AsynchroniousCommands from errors import EquipmentException, UnavailableContactException, UserNotFindException -from utils import StringUtils, TuxDroidServerUtils, SkypeClient +from utils import StringUtils, TuxDroidServerUtils, SkypeClient, AudioUtils from IPN.IPNServer import IPNServer from IPN.IPNClient import IPNClient @@ -111,7 +111,7 @@ mutex = threading.Lock() #Used for run command only. - command = "" + command = None canrun = True #Used for outgoing parameter only. @@ -160,10 +160,13 @@ def onPluginStop(self): '''OnPluginStop event. ''' - if self.getCommand() == 'check': - self.serv.stop() - if self.getCommand() == 'run': - self.client.stop() + try: + if self.getCommand() == 'check': + self.serv.stop() + if self.getCommand() == 'run': + self.client.stop() + except: + pass ##---------------------------------------------------------------- @@ -192,6 +195,11 @@ return if eventName == 'head': + #If no commands defined, then quit plugin. + + if self.command is None: + self.client.notify(END) + #Incoming call head button if self.command == COMMAND_INCOMING: self.client.notify(ACCEPT_INCOMING) @@ -506,10 +514,11 @@ time.sleep(1.0) #Setting Tux Droid as audio peripheral. + try: #in try statement to take calls in care. if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): - self.synchronious.setAudioCards() + self.throwTrace(self.synchronious.setAudioCards()) except: pass @@ -596,6 +605,10 @@ elif Message == CALL_CONTACT: thread = threading.Thread(target=self.callCurrentContact) thread.start() + + #Global close request from client. + elif Message == END: + self.serv.notify(END) if __name__ == "__main__": Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-22 15:23:13 UTC (rev 6010) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/utils.py 2009-12-24 14:01:51 UTC (rev 6011) @@ -300,7 +300,7 @@ idx, deviceName = AudioUtils.getSoundDeviceByKeywordWin32("tuxdroid-audio") return deviceName else: - return "plughw:TuxDroid,0" + return "TuxDroid (plughw:TuxDroid,0)" # -------------------------------------------------------------------------- # Get the sound device name of Tux Droid Micro. @@ -324,7 +324,7 @@ pass return None else: - return "plughw:TuxDroid,0" + return "TuxDroid (plughw:TuxDroid,0)" #Static methods declaration. @@ -440,4 +440,4 @@ #Static methods declaration. getServerPort = staticmethod(getServerPort) - sendRequest = staticmethod(sendRequest) \ No newline at end of file + sendRequest = staticmethod(sendRequest) |
From: jerome <c2m...@c2...> - 2009-12-22 15:23:25
|
Author: jerome Date: 2009-12-22 16:23:13 +0100 (Tue, 22 Dec 2009) New Revision: 6010 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py Log: * Fixed api connection error in Linux. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-22 11:48:01 UTC (rev 6009) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py 2009-12-22 15:23:13 UTC (rev 6010) @@ -162,7 +162,10 @@ if status == Skype4Py.apiAttachAvailable: self.skype.OnAttachmentStatus = self.__new_skype_status__ #Attaching api. - self.skype.Attach() + try: + self.skype.Attach() + except: + pass #Skype api was attached successfully, initializing values. if status == Skype4Py.apiAttachSuccess: |
From: jerome <c2m...@c2...> - 2009-12-22 11:48:20
|
Author: jerome Date: 2009-12-22 12:48:01 +0100 (Tue, 22 Dec 2009) New Revision: 6009 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py Log: * Added try except statement while loading the current user ( skype api return an access denied for some linux platforms ). Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py 2009-12-22 10:48:42 UTC (rev 6008) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py 2009-12-22 11:48:01 UTC (rev 6009) @@ -124,8 +124,11 @@ # -------------------------------------------------------------------------- def __fetch_contacts__(self): '''Querry client api to fetch contact list. - ''' - if self.currentUser != self.connectionObj.getSkypeAPI().CurrentUser: + ''' + try: + if self.currentUser != self.connectionObj.getSkypeAPI().CurrentUser: + self.contacts = [] + except: self.contacts = [] #Getting Skype connector lock before starting. |
From: jerome <c2m...@c2...> - 2009-12-22 10:48:50
|
Author: jerome Date: 2009-12-22 11:48:42 +0100 (Tue, 22 Dec 2009) New Revision: 6008 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Changed and improved the way to send commands ( more 'readable' ). Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-22 10:46:53 UTC (rev 6007) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-22 10:48:42 UTC (rev 6008) @@ -39,6 +39,7 @@ from IPN.IPNServer import IPNServer from IPN.IPNClient import IPNClient +from IPNCommands import * from util.SimplePlugin.SimplePluginConfiguration import SimplePluginConfiguration from util.SimplePlugin.SimplePlugin import SimplePlugin @@ -59,8 +60,7 @@ ''' SimplePluginConfiguration.__init__(self) self.__throwEmoticons = True - self.__throwTTS = True - self.__isOutgoing = False + self.__throwTTS = True # -------------------------------------------------------------------------- # Return true if emoticons will be thrown. @@ -93,22 +93,6 @@ '''Set the throwTTS parameter value. ''' self.__throwTTS = throwTTS - - # -------------------------------------------------------------------------- - # Return the outgoing parameter value. - # -------------------------------------------------------------------------- - def getIsOutgoing(self): - '''Return the outgoing parameter value. - ''' - return self.__isOutgoing - - # -------------------------------------------------------------------------- - # Set the outgoing parameter value. - # -------------------------------------------------------------------------- - def setIsOutgoing(self, isOutgoing): - '''Set the outgoing parameter value. - ''' - self.__isOutgoing = isOutgoing class SkypePlugin(SimplePlugin): @@ -133,28 +117,22 @@ #Used for outgoing parameter only. onlineList = [] currentContact = -1 - partner = "" + partner = None + initialized = False + isIncoming = False + isOutgoingUser = True + clientStartedByPlugin = False ##---------------------------------------------------------------- ## * Skype plugin main entry point. ##---------------------------------------------------------------- def start(self): + '''Plugin entry point. ''' - Plugin entry point. - This method should be used to dispatch commands. - ''' - #Check if skype is installed. - if not SkypeClient.isSkypeClientInstalled(): - if self.getCommand() != "check": - self.throwNotification("start") - self.throwMessage("Sorry, it looks like skype is not installed. Please go to the skype website to download the software.") - self.throwNotification("stop") - self.stop() - + self.checkSkype() #Init port. self.port = TuxDroidServerUtils.getServerPort() - #Check for the command. if self.getCommand() == "check": self.runDaemon() @@ -163,143 +141,148 @@ else: self.runDaemon() + + def checkSkype(self): + '''Check for skype installed. + ''' + #Check if skype is installed. + if not SkypeClient.isSkypeClientInstalled(): + if self.getCommand() != "check": + self.throwNotification("start") + self.throwMessage("Sorry, it looks like skype is not installed. Please go to the skype website to download the software.") + self.throwNotification("stop") + self.stop() + + ##---------------------------------------------------------------- - ## * PLUGIN COMMAND : Set Tux Droid for an incoming call call. + ## * Tux Droid plugin events. ##---------------------------------------------------------------- + def onPluginStop(self): + '''OnPluginStop event. + ''' + if self.getCommand() == 'check': + self.serv.stop() + if self.getCommand() == 'run': + self.client.stop() + + + ##---------------------------------------------------------------- + ## * PLUGIN RUN COMMAND + ##---------------------------------------------------------------- def run(self): + '''Initialize Tux Droid switches for a call ( incoming or outgoing ) ''' - Initialize Tux Droid switches for a call ( incoming or outgoing ) - ''' self.client = IPNClient('127.0.0.1', 48536) self.client.registerOnNotificationCallBack(self.ClientOnNotification) - self.client.registerOnConnectedCallBack(self.ClientOnConnected) self.client.start() - - if self.configuration().getIsOutgoing(): - self.client.notify('get_outgoing_command') - def incomingPluginEvent(self, eventName, eventValues): + def stopTTS(self): + '''Stop the tts. ''' - Tux Droid plugin event callback. - ''' request = '/tts/stop?' - if self.command == 'incoming': - #Accept call - if eventName == 'head': - #Stop current tts message. - TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - self.client.notify('accept_call') - #Reject Call - elif eventName in ['left', 'right']: - TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - self.client.notify('reject_call') - - #endcall command, waiting for the call ends. - if self.command == 'wait_end_call': - if eventName == 'head': - #Then send finish call command to IPN server. - self.client.notify('end_call') + TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - - def outgoingPluginEvent(self, eventName, eventValues): + + def onPluginEvent(self, eventName, eventValues): + '''Callback on plugin event. ''' - Tux Droid event callback for outgoing calls. - ''' - if self.command == 'outgoing': - #Proceed call - if eventName == 'head': - self.client.notify('call_contact') - - #Next contact - elif eventName == 'left': - self.client.notify('next_contact') - elif eventName == 'right': - self.client.notify('previous_contact') + #Start the adequate function for each plugin command. + if not self.getCommand() == 'run': + return - #endcall command, waiting for the call ends. - if self.command == 'wait_end_call': - if eventName == 'head': - #Then send finish call command to IPN server. - self.client.notify('end_call') + if eventName == 'head': + #Incoming call head button + if self.command == COMMAND_INCOMING: + self.client.notify(ACCEPT_INCOMING) + self.command = WAIT_END_CALL + self.stopTTS() + elif self.command == WAIT_END_CALL: + self.client.notify(CLOSE_CALL) + #Outgoing call head button + elif self.command == COMMAND_OUTGOING_USER: + self.client.notify(CALL_CONTACT) + self.command = WAIT_END_CALL + self.stopTTS() + self.throwNotification("start") + self.throwActuation("openMouth") + self.throwActuation("upFlippers") + self.throwNotification("stop") + + elif eventName == 'left': + #Incoming call left flipper + if self.command == COMMAND_INCOMING: + self.client.notify(REJECT_INCOMING) + #Outgoing call left flipper + elif self.command == COMMAND_OUTGOING_USER: + self.client.notify(NEXT_CONTACT) + + elif eventName == 'right': + #Incoming call right fliper + if self.command == COMMAND_INCOMING: + self.client.notify(REJECT_INCOMING) + + #Outgoing call right fliper. + elif self.command == COMMAND_OUTGOING_USER: + self.client.notify(PREVIOUS_CONTACT) + def ClientOnNotification(self, Message): + '''Recieved a message from server. ''' - Recieved a message from server. - ''' - thread = threading.Thread(target=self.OnNotification, args = (Message, )) - thread.start() + #Commands recaived at plugin startup. + if Message == COMMAND_INCOMING: + self.command = COMMAND_INCOMING + #Asking call partner. + self.client.notify(GET_INCOMING_CALL_PARTNER) + + elif Message == COMMAND_OUTGOING_USER: + self.command = COMMAND_OUTGOING_USER + self.client.notify(GET_CONTACTS_LIST) - - def OnNotification(self, Message): - ''' - Threaded client notification. - ''' - if Message == 'command>incoming': + elif Message == COMMAND_OUTGOING_INTERFACE: + self.command = COMMAND_OUTGOING_INTERFACE + #Simply open mouth and up flippers self.throwNotification("start") + self.throwActuation("openMouth") self.throwActuation("upFlippers") self.throwNotification("stop") - self.command = 'incoming' + #the only available comand is to wait for call ends. + self.command = WAIT_END_CALL - elif Message == 'command>wait_end_call': - self.command = 'wait_end_call' - - #Flippers up and mouth open if outgoing call. - if self.configuration().getIsOutgoing(): - #Stop tts. - request = '/tts/stop?' - TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - self.throwNotification("start") - self.throwActuation("upFlippers") - self.throwActuation("openMouth") - self.throwNotification("stop") - - elif Message == 'command>endcall': + elif Message[:1].find(GET_INCOMING_CALL_PARTNER) != -1: + #Stop current tts message. + self.stopTTS() + time.sleep(0.2) self.throwNotification("start") - self.throwActuation("downFlippers") - self.throwActuation("closeMouth") + #Once we have call partnet, setting up Tux Droid. + self.throwActuation("upFlippers") + self.throwMessage('{0} is calling you', Message[1:]) + self.throwActuation("openMouth") self.throwNotification("stop") - self.stop() - elif Message[:4].find('tts>') != -1: + elif Message[:1].find(COMMAND_TTS) != -1: #Stop current tts message. - request = '/tts/stop?' - TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) + self.stopTTS() + time.sleep(0.2) self.throwNotification("start") - self.throwMessage('%s' % Message[4:]) + self.throwMessage(Message[1:]) self.throwNotification("stop") - - elif Message[:18].find("tts_incoming_call>") != -1: - if self.command != "incoming": - return + + elif Message == END: self.throwNotification("start") - self.throwMessage('{0} is calling you', Message[18:]) - #Re - open mouth - self.throwActuation("openMouth") + self.throwActuation("downFlippers") + self.throwActuation("closeMouth") self.throwNotification("stop") + self.stopTTS() + self.stop() + - elif Message == 'command>interface_outgoing_call': - self.throwNotification("start") - self.throwActuation("upFlippers") - self.throwActuation("openMouth") - self.throwNotification("stop") - self.command = 'wait_end_call' - - elif Message == 'command>user_outgoing_call': - self.command = 'outgoing' - self.client.notify('get_contacts') - - def ClientOnConnected(self, id): - ''' - ''' - pass - - ##---------------------------------------------------------------- - ## * DAEMON command and functions. + ## * DAEMON commands and functions. ##---------------------------------------------------------------- def runDaemon(self): @@ -310,11 +293,9 @@ self.serv = IPNServer('127.0.0.1', 48536) self.serv.registerOnClientAddedCallBack(self.ServerOnClientAdded) - self.serv.registerOnClientRemovedCallBack(self.ServerOnClientRemoved) self.serv.registerOnClientNotificationCallBack(self.ServerOnClientNotification) self.serv.start() - #Initialize skype client and api objects. self.connectorObj = connector.Connector() self.connectorObj.OnAPIReady = self.initializeDaemon @@ -352,7 +333,9 @@ self.asynchronious.OnOutgoingCall = self.OnOutgoingCall self.asynchronious.OnOutgoingFinished = self.OnOutgoingFinished - self.asynchronious.OnlineContactStatusChanged = self.ContactStatusChanged + self.mutex.acquire() + self.initialized = True + self.mutex.release() def OnIncomingRefused(self, contactHandle): @@ -380,6 +363,7 @@ ''' Incoming call event. ''' + self.isIncoming = True #Set up Tux Droid motors. self.partner = self.synchronious.getTTSName(contactHandle) thread = threading.Thread(target=self.startRunMode) @@ -393,8 +377,6 @@ ''' request = '/plugins_server/start_plugin?command=run&uuid='+ self.uuid +'¶meters=' TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - self.command = 'incoming' - self.serv.notify("tts>%s" % tts) def OnIncomingFinished(self, contactHandle): @@ -402,30 +384,32 @@ Incoming call finished event. ''' #Send reset switches signal. - self.serv.notify('command>endcall') - self.command = "" - + self.serv.notify(END) def OnOutgoingCall(self, contactHandle): ''' - Outgoing call in progress event. + Outgoing call in progress callback. ''' #If call was done from skype client interface, then start the plugin - if not ( self.command == 'user_outgoing_call' ): - parameters = 'isOutgoing=true' - request = '/plugins_server/start_plugin?command=run&uuid='+ self.uuid +'¶meters=' + parameters + if ( not self.serv.hasClient() ): + self.isOutgoingUser = False + request = '/plugins_server/start_plugin?command=run&uuid='+ self.uuid +'¶meters=' TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) - self.command = 'interface_outgoing_call' - + + def OnOutgoingFinished(self, contactHandle): ''' + Outgoing call finished callback. ''' + #Stop Skype client if it was started by the plugin. + if self.clientStartedByPlugin: + self.connectorObj.stopClient() + self.clientStartedByPlugin = False #Send reset switches signal. - self.serv.notify('command>endcall') - self.command = "" + self.serv.notify(END) def OnChatMessage(self, contactHandle): @@ -466,8 +450,15 @@ ''' Call the current selected contact. ''' + if not self.connectorObj.isClientRunning(): + self.serv.notify(END) + return + if self.onlineList[self.currentContact] == 'Quit gadget': - self.serv.notify("command>endcall") + if self.clientStartedByPlugin: + self.connectorObj.stopClient() + self.clientStartedByPlugin = False + self.serv.notify(END) else: self.synchronious.call(self.onlineList[self.currentContact]) @@ -483,7 +474,7 @@ if self.currentContact >= len(self.onlineList): self.currentContact = 0 - self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) + self.serv.notify(COMMAND_TTS + self.onlineList[self.currentContact]) finally: time.sleep(0.4) self.mutex.release() @@ -501,7 +492,7 @@ #Then going to the last online list entry. self.currentContact = len(self.onlineList) - 1 - self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) + self.serv.notify(COMMAND_TTS + self.onlineList[self.currentContact]) finally: time.sleep(0.4) self.mutex.release() @@ -521,118 +512,91 @@ self.synchronious.setAudioCards() except: pass - - - - ##---------------------------------------------------------------- - ## * Tux Droid plugin events. - ##---------------------------------------------------------------- - def onPluginStop(self): - ''' - OnPluginStop event. - ''' - if self.getCommand() == 'run': - self.client.stop() - else: - if self.connectorObj != None: - if self.getCommand() == 'outgoingCall': - #TODO update this function. - self.connectorObj.stop(KillClient=True) - else: - #In other cases, close connection but not skype client. - self.connectorObj.stop() - - - - def onPluginEvent(self, eventName, eventValues): - ''' - Callback on plugin event. - @param eventName: Event name. - @param eventValues: Event values. - ''' - #Start the adequate function for each plugin command. - if self.getCommand() == 'run': - if not self.configuration().getIsOutgoing(): - self.incomingPluginEvent(eventName, eventValues) - else: - self.outgoingPluginEvent(eventName, eventValues) - - + ##---------------------------------------------------------------- ## * DAEMON Client / Server IPN Communication. ##---------------------------------------------------------------- def ServerOnClientAdded(self, idClient): ''' + Server IPN callback when IPN client is added. ''' - if not self.configuration().getIsOutgoing(): - self.serv.notify( "command>" + self.command ) - time.sleep(0.2) - #Sending call partner tts name. - self.serv.notify("tts_incoming_call>%s" % self.partner) - self.partner = "" - - def ServerOnClientRemoved(self, idClient): - ''' - ''' - pass + #First action, sending command to the plugin client. + if self.isIncoming: + #Then it's an incoming call. + self.serv.notify(COMMAND_INCOMING) + elif self.isOutgoingUser: + if not self.connectorObj.isClientRunning(): + self.connectorObj.startClient() + while ( not self.initialized ): + time.sleep(2.0) + self.initialized = False + self.clientStartedByPlugin = True + #Then interface outgoing call. + self.serv.notify(COMMAND_OUTGOING_USER) + else: + #Then user uses TuxBox to make a call. + self.serv.notify(COMMAND_OUTGOING_INTERFACE) + #Finally, reset values. + self.isIncoming = False + self.isOutgoingUser = True + + def ServerOnClientNotification(self, idClient, Message): ''' ''' - #-------- Incoming IPN messages --------# - if Message == 'accept_call': + #-------------- Incoming call commands --------------# + #Request to get current call partner. + if Message == GET_INCOMING_CALL_PARTNER: + if self.partner != None: + self.serv.notify(GET_INCOMING_CALL_PARTNER + self.partner) + else: + self.serv.notify(GET_INCOMING_CALL_PARTNER + "unknown") + + #Request to accept current incoming call + elif Message == ACCEPT_INCOMING: if self.asynchronious.call != None: - #Take call - self.serv.notify('command>wait_end_call') thread = threading.Thread(target=self.synchronious.acceptCall, args =(self.asynchronious.call, )) thread.start() - - elif Message == 'reject_call' : - #Reject call. + + #Request to reject current incoming call + elif Message == REJECT_INCOMING: self.synchronious.rejectCall() + self.serv.notify(END) - #-------- Outgoing IPN messages --------# - elif Message == 'get_contacts': - #Outgoing call requested, so getting online list and sending outgoing command. - self.onlineList = self.synchronious.getOnlineList() - #Adding fake 'Quit gadget' contact. + #-------------- Common call commands --------------# + #Request to close the current call + elif Message == CLOSE_CALL: + self.synchronious.finishCall() + + #-------------- Outgoing call commands --------------# + elif Message == GET_CONTACTS_LIST: + try: + self.onlineList = self.synchronious.getOnlineList() + except: + self.onlineList = [] self.onlineList.append("Quit gadget") - time.sleep(0.4) - #And throwing the first online contact in list. - self.nextContact() + time.sleep(0.3) - #Outgoing - elif Message == 'call_contact': - #Proceed call. - self.serv.notify('command>wait_end_call') - thread = threading.Thread(target=self.callCurrentContact) - thread.start() - - elif Message == 'next_contact': + #at least one user find. + if len(self.onlineList) > 1: + self.currentContact = 0 + self.serv.notify( COMMAND_TTS + self.onlineList[0] ) + + + elif Message == NEXT_CONTACT: thread = threading.Thread(target=self.nextContact) thread.start() - - elif Message == 'previous_contact': + elif Message == PREVIOUS_CONTACT: thread = threading.Thread(target=self.previousContact) thread.start() - - elif Message == 'get_outgoing_command': - if self.command == 'interface_outgoing_call': - #User call someone with Skype client interface. - self.serv.notify('command>interface_outgoing_call') - self.command = 'interface_outgoing_call' - else: - #User pick contact from tuxdroid - self.serv.notify('command>user_outgoing_call') - self.command = 'user_outgoing_call' - - #-------- Common IPN messages --------# - elif Message == 'end_call': - self.synchronious.finishCall() - + elif Message == CALL_CONTACT: + thread = threading.Thread(target=self.callCurrentContact) + thread.start() + if __name__ == "__main__": plugin = SkypePlugin() |