1 """Skype client settings.
2 """
3 __docformat__ = 'restructuredtext en'
4
5
6 import sys
7 import weakref
8
9 from utils import *
10
11
13 """Represents Skype settings. Access using `skype.Skype.Settings`.
14 """
15
17 """__init__.
18
19 :Parameters:
20 Skype : `Skype`
21 Skype
22 """
23 self._SkypeRef = weakref.ref(Skype)
24
25 - def Avatar(self, Id=1, Set=None):
26 """Sets user avatar picture from file.
27
28 :Parameters:
29 Id : int
30 Optional avatar Id.
31 Set : str
32 New avatar file name.
33
34 :deprecated: Use `LoadAvatarFromFile` instead.
35 """
36 from warnings import warn
37 warn('Settings.Avatar: Use Settings.LoadAvatarFromFile instead.', DeprecationWarning, stacklevel=2)
38 if Set is None:
39 raise TypeError('Argument \'Set\' is mandatory!')
40 self.LoadAvatarFromFile(Set, Id)
41
43 """Loads user avatar picture from file.
44
45 :Parameters:
46 Filename : str
47 Name of the avatar file.
48 AvatarId : int
49 Optional avatar Id.
50 """
51 s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename))
52 self._Skype._DoCommand('SET %s' % s, s)
53
55 """Reset Skype idle timer.
56 """
57 self._Skype._DoCommand('RESETIDLETIMER')
58
60 """Returns/sets a ringtone.
61
62 :Parameters:
63 Id : int
64 Ringtone Id
65 Set : str
66 Path to new ringtone or None if the current path should be queried.
67
68 :return: Current path if Set=None, None otherwise.
69 :rtype: str or None
70 """
71 if Set is None:
72 return unicode2path(self._Skype._Property('RINGTONE', Id, ''))
73 self._Skype._Property('RINGTONE', Id, '', path2unicode(Set))
74
76 """Enables/disables a ringtone.
77
78 :Parameters:
79 Id : int
80 Ringtone Id
81 Set : bool
82 True/False if the ringtone should be enabled/disabled or None if the current status
83 should be queried.
84
85 :return: Current status if Set=None, None otherwise.
86 :rtype: bool
87 """
88 if Set is None:
89 return (self._Skype._Property('RINGTONE', Id, 'STATUS') == 'ON')
90 self._Skype._Property('RINGTONE', Id, 'STATUS', cndexp(Set, 'ON', 'OFF'))
91
93 """Saves user avatar picture to file.
94
95 :Parameters:
96 Filename : str
97 Destination path.
98 AvatarId : int
99 Avatar Id
100 """
101 s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename))
102 self._Skype._DoCommand('GET %s' % s, s)
103
105 skype = self._SkypeRef()
106 if skype:
107 return skype
108 raise ISkypeError('Skype4Py internal error')
109
110 _Skype = property(_Get_Skype)
111
113 return (self._Skype.Variable('AEC') == 'ON')
114
117
118 AEC = property(_GetAEC, _SetAEC,
119 doc="""Automatic echo cancellation state.
120
121 :type: bool
122
123 :warning: Starting with Skype for Windows 3.6, this property has no effect. It can still be set
124 for backwards compatibility reasons.
125 """)
126
128 return (self._Skype.Variable('AGC') == 'ON')
129
132
133 AGC = property(_GetAGC, _SetAGC,
134 doc="""Automatic gain control state.
135
136 :type: bool
137
138 :warning: Starting with Skype for Windows 3.6, this property has no effect. It can still be set
139 for backwards compatibility reasons.
140 """)
141
143 return self._Skype.Variable('AUDIO_IN')
144
146 self._Skype.Variable('AUDIO_IN', Value)
147
148 AudioIn = property(_GetAudioIn, _SetAudioIn,
149 doc="""Name of an audio input device.
150
151 :type: unicode
152 """)
153
155 return self._Skype.Variable('AUDIO_OUT')
156
158 self._Skype.Variable('AUDIO_OUT', Value)
159
160 AudioOut = property(_GetAudioOut, _SetAudioOut,
161 doc="""Name of an audio output device.
162
163 :type: unicode
164 """)
165
167 return (self._Skype.Variable('AUTOAWAY') == 'ON')
168
171
172 AutoAway = property(_GetAutoAway, _SetAutoAway,
173 doc="""Auto away status.
174
175 :type: bool
176 """)
177
179 return str(self._Skype.Variable('UI_LANGUAGE'))
180
182 self._Skype.Variable('UI_LANGUAGE', Value)
183
184 Language = property(_GetLanguage, _SetLanguage,
185 doc="""Language of the Skype client as an ISO code.
186
187 :type: str
188 """)
189
191 return (self._Skype.Variable('PCSPEAKER') == 'ON')
192
195
196 PCSpeaker = property(_GetPCSpeaker, _SetPCSpeaker,
197 doc="""PCSpeaker status.
198
199 :type: bool
200 """)
201
203 return self._Skype.Variable('RINGER')
204
206 self._Skype.Variable('RINGER', Value)
207
208 Ringer = property(_GetRinger, _SetRinger,
209 doc="""Name of a ringer device.
210
211 :type: unicode
212 """)
213
215 return self._Skype.Variable('VIDEO_IN')
216
218 self._Skype.Variable('VIDEO_IN', Value)
219
220 VideoIn = property(_GetVideoIn, _SetVideoIn,
221 doc="""Name of a video input device.
222
223 :type: unicode
224 """)
225