2
# ----------------------------------------------------------------------------------------------------
3
# Python / Skype4Py example that sets user's online status to Do Not Disturb
9
# ----------------------------------------------------------------------------------------------------
10
# Fired on attachment status change. If attachment to API is successful,
11
# this function sets skype.CurrentUserStatus to 'DND'.
14
print 'API attachment status: ' + skype.Convert.AttachmentStatusToText(status)
16
if status == Skype4Py.apiAttachAvailable:
19
if status == Skype4Py.apiAttachSuccess:
20
print 'Setting online status to online'
21
skype.CurrentUserStatus = 'online';
23
# ----------------------------------------------------------------------------------------------------
24
# Fired on user's online status change. Prints out new status.
26
def OnUserStatus(status):
27
print 'User status has changed to ' + status
30
# ----------------------------------------------------------------------------------------------------
31
# Creating instance of Skype object, assigning handler functions and attaching to Skype.
33
skype = Skype4Py.Skype()
34
skype.OnAttachmentStatus = OnAttach
35
skype.OnUserStatus = OnUserStatus
37
print 'Connecting to Skype..'
40
# ----------------------------------------------------------------------------------------------------
41
# Looping until user types 'exit'
43
#while not Cmd == 'exit':
44
# Cmd = raw_input('');