[tuxdroid-svn] r5982 - 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-15 13:59:47
|
Author: jerome Date: 2009-12-15 14:59:29 +0100 (Tue, 15 Dec 2009) New Revision: 5982 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Added mutex for previous and next contact function. * Added a 0.4 sec delay before throwing first contact. 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-15 13:44:04 UTC (rev 5981) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-15 13:59:29 UTC (rev 5982) @@ -112,6 +112,8 @@ asynchronious = None connectorObj = None + mutex = threading.Lock() + #Used for run command only. command = "" canrun = True @@ -437,21 +439,24 @@ Go next in the online contacts list. ''' try: + self.mutex.acquire() self.currentContact += 1 if self.currentContact >= len(self.onlineList): self.currentContact = 0 self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) - except: - self.serv.notify('tts>%s' % self.onlineList[0]) - + finally: + time.sleep(0.4) + self.mutex.release() + def previousContact(self): ''' Go previous in the online contacts list. ''' try: + self.mutex.acquire() self.currentContact -= 1 if self.currentContact <= -1: @@ -459,10 +464,11 @@ self.currentContact = len(self.onlineList) - 1 self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) - except: - self.serv.notify('tts>%s' % self.onlineList[0]) + finally: + time.sleep(0.4) + self.mutex.release() + - def mainloop(self): ''' Run main loop. @@ -550,6 +556,7 @@ elif Message == 'get_contacts': #Outgoing call requested, so getting online list and sending outgoing command. self.onlineList = self.synchronious.getOnlineList() + time.sleep(0.4) #And throwing the first online contact in list. self.nextContact() |