[tuxdroid-svn] r6018 - in software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin: e
Status: Beta
Brought to you by:
ks156
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 "" |