Package Skype4Py
[frames] | no frames]

Source Code for Package Skype4Py

 1  # 
 2  # Skype4Py 
 3  # 
 4   
 5  ''' 
 6  Skype4Py is a multiplatform Skype API wrapper for Python. 
 7   
 8    1. Usage. 
 9   
10       C{Skype4Py} is the package that you should import in your scripts to be able to access Skype. 
11       You won't need to import any submodules. Everything you may need will be available at the 
12       package level. This includes: 
13   
14         - Classes 
15           - C{Skype4Py.Skype = L{Skype4Py.skype.ISkype}} 
16           - C{Skype4Py.CallChannelManager = L{Skype4Py.callchannel.ICallChannelManager}} 
17         - Constants 
18           - C{Skype4Py.* = L{Skype4Py.enums}.*} 
19         - Errors 
20           - C{Skype4Py.SkypeError = L{Skype4Py.errors.ISkypeError}} 
21           - C{Skype4Py.SkypeAPIError = L{Skype4Py.errors.ISkypeAPIError}} 
22   
23       The first two are the only classes that you will be instantiating directly. Calling their methods/properties 
24       will give you the access to instances of all other classes, you won't have to instantiate them yourself. 
25       The two classes are also the only ones that provide event handlers (for more information about events, 
26       see the L{EventHandlingBase} class which is a baseclass of the above two classes). 
27   
28       Every Skype4Py script instatinates the C{Skype4Py.Skype} class at least once. That's what you want to do 
29       first in your script. Then follow the L{Skype4Py.skype.ISkype} reference to see where you can get from 
30       there. 
31   
32    2. Quick example. 
33   
34       This short example connects to Skype client and prints the user's full name and the names of all the 
35       contacts from the contacts list:: 
36   
37           import Skype4Py 
38   
39           # Create Skype instance 
40           skype = Skype4Py.Skype() 
41   
42           # Connect Skype object to Skype client 
43           skype.Attach() 
44   
45           print 'Your full name:', skype.CurrentUser.FullName 
46           print 'Your contacts:' 
47           for user in skype.Friends: 
48               print '    ', user.FullName 
49   
50  @author: Arkadiusz Wahlig (arkadiusz.wahlig at googlemail) 
51  @requires: Python 2.4 or newer (not yet 3.0) 
52  @see: U{The Skype4Py webpage<https://developer.skype.com/wiki/Skype4Py>} 
53  @license: BSD License (see the accompanying LICENSE file for more information) 
54  @copyright: S{copy} 2007-2008 Arkadiusz Wahlig 
55  ''' 
56   
57  from skype import ISkype as Skype 
58  from callchannel import ICallChannelManager as CallChannelManager 
59  from errors import ISkypeError as SkypeError, ISkypeAPIError as SkypeAPIError 
60  from enums import * 
61   
62   
63  __version__ = '1.0.31.0' 
64  '''The version of Skype4Py.''' 
65