[tuxdroid-svn] r5917 - in software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/exe
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-11-27 11:11:55
|
Author: jerome
Date: 2009-11-27 12:11:42 +0100 (Fri, 27 Nov 2009)
New Revision: 5917
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/tests/AsyncTests.py
Log:
* Incomming ==> Incoming.
* Started to add plugin events.
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-11-27 10:53:59 UTC (rev 5916)
+++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py 2009-11-27 11:11:42 UTC (rev 5917)
@@ -431,7 +431,7 @@
def acceptCall(self, Call):
'''
- Accept an incomming call.
+ Accept an incoming call.
'''
self.__get_call__(Call)
@@ -459,18 +459,18 @@
connectorObj = None
call = None
- ##### Incomming triggered events. ####
+ ##### incoming triggered events. ####
#@Params : ttsName skype name otherwise.
- OnIncommingCall = None
+ OnIncomingCall = None
- OnIncommingFinished = None
+ OnIncomingFinished = None
#@Params : ttsName, skype name otherwise.
- OnIncommingMessage = None
+ OnIncomingMessage = None
- #Incomming call was refused because a call is in progress.
+ #incoming call was refused because a call is in progress.
# Sending event with user handle that tries to call.
- OnIncommingCallRefused = None
+ OnIncomingCallRefused = None
#### Outgoing triggered events ####
#@Params : ttsName, cut number otherwise.
@@ -517,20 +517,20 @@
def __on_call_status__(self, Call, Status):
'''
- Event handler for skype client incomming / outgoing calls.
+ Event handler for skype client incoming / outgoing calls.
'''
if Call.Type in [ Skype4Py.cltIncomingPSTN, Skype4Py.cltIncomingP2P]:
- #Incomming call.
- self.__on_incomming_call__(Call, Status)
+ #incoming call.
+ self.__on_incoming_call__(Call, Status)
else:
#Outgoing call.
self.__on_outgoing_call__(Call, Status)
- def __on_incomming_call__(self, Call, Status):
+ def __on_incoming_call__(self, Call, Status):
'''
- Trigger incomming call events.
+ Trigger incoming call events.
'''
if ( self.call is None ):
self.call = Call
@@ -540,15 +540,15 @@
partnerHandle = Call.PartnerHandle
if Status == Skype4Py.clsRinging:
- if self.OnIncommingCall != None:
- thread = threading.Thread(target=self.OnIncommingCall, args = [partnerHandle, ])
+ if self.OnIncomingCall != None:
+ thread = threading.Thread(target=self.OnIncomingCall, args = [partnerHandle, ])
thread.start()
elif Status in [Skype4Py.clsFinished, Skype4Py.clsRefused,
Skype4Py.clsMissed, Skype4Py.clsFailed]:
- if self.OnIncommingFinished != None:
+ if self.OnIncomingFinished != None:
self.call = None
- thread = threading.Thread(target=self.OnIncommingFinished, args = [partnerHandle, ])
+ thread = threading.Thread(target=self.OnIncomingFinished, args = [partnerHandle, ])
thread.start()
else:
@@ -562,8 +562,8 @@
pass
finally:
#Sending call refused event.
- if ( self.OnIncommingCallRefused != None ) and ( Status == Skype4Py.clsRefused ):
- thread = threading.Thread(target=self.OnIncommingCallRefused, args = [Call.PartnerHandle, ])
+ if ( self.OnIncomingCallRefused != None ) and ( Status == Skype4Py.clsRefused ):
+ thread = threading.Thread(target=self.OnIncomingCallRefused, args = [Call.PartnerHandle, ])
thread.start()
@@ -645,8 +645,8 @@
if chat.Name == Message.ChatName:
#throwing event.
- if self.OnIncommingMessage != None:
- thread = threading.Thread(target=self.OnIncommingMessage, args=[handle, ])
+ if self.OnIncomingMessage != None:
+ thread = threading.Thread(target=self.OnIncomingMessage, args=[handle, ])
thread.start()
#Checking for matching emoticons / attitunes.
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-11-27 10:53:59 UTC (rev 5916)
+++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-11-27 11:11:42 UTC (rev 5917)
@@ -116,8 +116,44 @@
#Setting asynchronious obj.
self.asynchronious = AsynchroniousCommands(self.connectorObj)
+ #Setting events.
+ asynchronious.OnIncomingMessage = self.OnChatMessage
+ asynchronious.OnAvailableEmoticon = self.OnEmoticon
+ asynchronious.OnAvailableTTSSentence = self.OnTTS
+ asynchronious.OnIncomingCallRefused = self.OnIncomingRefused
+ asynchronious.OnIncomingCall = self.OnIncomingCall
+ asynchronious.OnIncomingFinished = self.OnIncomingFinished
+ asynchronious.OnOutgoingCallRefused = self.OnOutgoingRefused
+ asynchronious.OnOutgoingCall = self.OnOutgoingCall
+ asynchronious.OnOutgoingFinished = self.OnOutgoingFinished
+
+
+ def OnChatMessage(self, contactHandle):
+ '''
+ Event that notify of incoming chat message.
+ '''
+ pass
+
+
+ def OnEmoticon(self, attName):
+ '''
+ Event that notify of incoming emoticon.
+ '''
+ pass
+
+
+ def OnTTS(self, sentence):
+ '''
+ Event that notify a tts sentence to be said by Tux Droid.
+ '''
+ pass
+
+
+ def OnincomingRefused
+
+
def mainloop(self):
'''
Run main loop.
Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/tests/AsyncTests.py
===================================================================
--- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/tests/AsyncTests.py 2009-11-27 10:53:59 UTC (rev 5916)
+++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/tests/AsyncTests.py 2009-11-27 11:11:42 UTC (rev 5917)
@@ -55,7 +55,7 @@
print 'Tux Droid TTS>>> %s' % message
-def onIncommingRefused(contactHandle):
+def onIncomingRefused(contactHandle):
'''
Call refused event used to send a message to the remote caller.
'''
@@ -63,14 +63,14 @@
synchronious.sendTextMessage(contactHandle, "Sorry, I'm on phone, try again later please.")
-def onIncommingCall(contactHandle):
+def onIncomingCall(contactHandle):
'''
A contact try to call current user.
'''
print '%s is calling you' % contactHandle
-def onIncommingFinished(contactHandle):
+def onIncomingFinished(contactHandle):
'''
A call was just finished.
'''
@@ -110,9 +110,9 @@
asynchronious.OnAvailableEmoticon = onEmoticon
asynchronious.OnAvailableTTSSentence = onTTS
- asynchronious.OnIncommingCallRefused = onIncommingRefused
- asynchronious.OnIncommingCall = onIncommingCall
- asynchronious.OnIncommingFinished = onIncommingFinished
+ asynchronious.OnIncommingCallRefused = onIncomingRefused
+ asynchronious.OnIncommingCall = onIncomingCall
+ asynchronious.OnIncommingFinished = onIncomingFinished
asynchronious.OnOutgoingCallRefused = onOutgoingRefused
asynchronious.OnOutgoingCall = onOutgoingCall
|