[tuxdroid-svn] r6023 - software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/execut
Status: Beta
Brought to you by:
ks156
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. |