1 '''Skype settings.
2 '''
3
4 import weakref
5 import sys
6 from utils import *
7
8
10 '''Represents Skype settings. Access using L{ISkype.Settings<skype.ISkype.Settings>}.
11 '''
12
14 '''__init__.
15
16 @param Skype: Skype
17 @type Skype: L{ISkype}
18 '''
19 self._SkypeRef = weakref.ref(Skype)
20
21 - def Avatar(self, Id=1, Set=None):
22 '''Sets user avatar picture from file.
23
24 @param Id: Optional avatar Id.
25 @type Id: int
26 @param Set: New avatar file name.
27 @type Set: unicode
28 @deprecated: Use L{LoadAvatarFromFile} instead.
29 '''
30 from warnings import warn
31 warn('ISettings.Avatar: Use ISettings.LoadAvatarFromFile instead.', DeprecationWarning, stacklevel=2)
32 if Set == None:
33 raise TypeError('Argument \'Set\' is mandatory!')
34 self.LoadAvatarFromFile(Set, Id)
35
37 '''Loads user avatar picture from file.
38
39 @param Filename: Name of the avatar file.
40 @type Filename: unicode
41 @param AvatarId: Optional avatar Id.
42 @type AvatarId: int
43 '''
44 s = 'AVATAR %s %s' % (AvatarId, Filename)
45 self._Skype._DoCommand('SET %s' % s, s)
46
48 '''Reset Skype idle timer.
49 '''
50 self._Skype._DoCommand('RESETIDLETIMER')
51
53 '''Returns/sets a ringtone.
54
55 @param Id: Ringtone Id
56 @type Id: int
57 @param Set: Path to new ringtone or None if the current path should be queried.
58 @type Set: unicode
59 @return: Current path if Set=None, None otherwise.
60 @rtype: unicode or None
61 '''
62 return self._Skype._Property('RINGTONE', Id, '', Set)
63
65 '''Enables/disables a ringtone.
66
67 @param Id: Ringtone Id
68 @type Id: int
69 @param Set: True/False if the ringtone should be enabled/disabled or None if the current
70 status should be queried.
71 @type Set: bool
72 @return: Current status if Set=None, None otherwise.
73 @rtype: bool
74 '''
75 if Set == None:
76 return self._Skype._Property('RINGTONE', Id, 'STATUS') == 'ON'
77 return self._Skype._Property('RINGTONE', Id, 'STATUS', cndexp(Set, 'ON', 'OFF'))
78
80 '''Saves user avatar picture to file.
81
82 @param Filename: Destination path.
83 @type Filename: unicode
84 @param AvatarId: Avatar Id
85 @type AvatarId: int
86 '''
87 s = 'AVATAR %s %s' % (AvatarId, Filename)
88 self._Skype._DoCommand('GET %s' % s, s)
89
91 skype = self._SkypeRef()
92 if skype:
93 return skype
94 raise Exception()
95
96 _Skype = property(_Get_Skype)
97
99 return self._Skype.Variable('AEC') == 'ON'
100
103
104 AEC = property(_GetAEC, _SetAEC,
105 doc='''Automatic echo cancellation state.
106
107 @type: bool
108 @warning: Starting with Skype for Windows 3.6, this property has no effect.
109 It can still be set for backwards compatibility reasons.
110 ''')
111
113 return self._Skype.Variable('AGC') == 'ON'
114
117
118 AGC = property(_GetAGC, _SetAGC,
119 doc='''Automatic gain control state.
120
121 @type: bool
122 @warning: Starting with Skype for Windows 3.6, this property has no effect.
123 It can still be set for backwards compatibility reasons.
124 ''')
125
127 return self._Skype.Variable('AUDIO_IN')
128
130 self._Skype.Variable('AUDIO_IN', value)
131
132 AudioIn = property(_GetAudioIn, _SetAudioIn,
133 doc='''Name of an audio input device.
134
135 @type: unicode
136 ''')
137
139 return self._Skype.Variable('AUDIO_OUT')
140
142 self._Skype.Variable('AUDIO_OUT', value)
143
144 AudioOut = property(_GetAudioOut, _SetAudioOut,
145 doc='''Name of an audio output device.
146
147 @type: unicode
148 ''')
149
151 return self._Skype.Variable('AUTOAWAY') == 'ON'
152
155
156 AutoAway = property(_GetAutoAway, _SetAutoAway,
157 doc='''Auto away status.
158
159 @type: bool
160 ''')
161
163 return self._Skype.Variable('UI_LANGUAGE')
164
166 self._Skype.Variable('UI_LANGUAGE', value)
167
168 Language = property(_GetLanguage, _SetLanguage,
169 doc='''Language of the Skype client as an ISO code.
170
171 @type: unicode
172 ''')
173
175 return self._Skype.Variable('PCSPEAKER') == 'ON'
176
179
180 PCSpeaker = property(_GetPCSpeaker, _SetPCSpeaker,
181 doc='''PCSpeaker status.
182
183 @type: bool
184 ''')
185
187 return self._Skype.Variable('RINGER')
188
190 self._Skype.Variable('RINGER', value)
191
192 Ringer = property(_GetRinger, _SetRinger,
193 doc='''Name of a ringer device.
194
195 @type: unicode
196 ''')
197
199 return self._Skype.Variable('VIDEO_IN')
200
202 self._Skype.Variable('VIDEO_IN', value)
203
204 VideoIn = property(_GetVideoIn, _SetVideoIn,
205 doc='''Name of a video input device.
206
207 @type: unicode
208 ''')
209