<s> """<STR_LIT>""" <EOL> __docformat__ = '<STR_LIT>' <EOL> import threading <EOL> import weakref <EOL> import logging <EOL> from api import * <EOL> from errors import * <EOL> from enums import * <EOL> from utils import * <EOL> from conversion import * <EOL> from client import * <EOL> from user import * <EOL> from call import * <EOL> from profile import * <EOL> from settings import * <EOL> from chat import * <EOL> from application import * <EOL> from voicemail import * <EOL> from sms import * <EOL> from filetransfer import * <EOL> class APINotifier ( SkypeAPINotifier ) : <EOL> def __init__ ( self , skype ) : <EOL> self . skype = weakref . proxy ( skype ) <EOL> def attachment_changed ( self , status ) : <EOL> try : <EOL> self . skype . _CallEventHandler ( '<STR_LIT>' , status ) <EOL> if status == apiAttachRefused : <EOL> raise SkypeAPIError ( '<STR_LIT>' ) <EOL> except weakref . ReferenceError : <EOL> pass <EOL> def notification_received ( self , notification ) : <EOL> try : <EOL> skype = self . skype <EOL> skype . _CallEventHandler ( '<STR_LIT>' , notification ) <EOL> a , b = chop ( notification ) <EOL> object_type = None <EOL> if a in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> object_type , object_id , prop_name , value = [ a ] + chop ( b , <NUM_LIT:2> ) <EOL> skype . _CacheDict [ str ( object_type ) , str ( object_id ) , str ( prop_name ) ] = value <EOL> if object_type == '<STR_LIT>' : <EOL> o = User ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' or prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , value ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = Call ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ( value == '<STR_LIT>' ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ( value == '<STR_LIT>' ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = Chat ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , UserCollection ( skype , split ( value ) ) ) <EOL> if prop_name in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ( prop_name == '<STR_LIT>' ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = ChatMember ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = ChatMessage ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = Application ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , UserCollection ( skype , split ( value ) ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ApplicationStreamCollection ( o , split ( value ) ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> handle , text = chop ( value ) <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ApplicationStream ( o , handle ) , text ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ApplicationStreamCollection ( o , ( x . split ( '<STR_LIT:=>' ) [ <NUM_LIT:0> ] for x in split ( value ) ) ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ApplicationStreamCollection ( o , ( x . split ( '<STR_LIT:=>' ) [ <NUM_LIT:0> ] for x in split ( value ) ) ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = Group ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ( value == '<STR_LIT>' ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , ( value == '<STR_LIT>' ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , int ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = SmsMessage ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif prop_name == '<STR_LIT>' : <EOL> for t in split ( value , '<STR_LIT:U+002CU+0020>' ) : <EOL> number , status = t . split ( '<STR_LIT:=>' ) <EOL> skype . _CallEventHandler ( '<STR_LIT>' , SmsTarget ( o , number ) , str ( status ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = FileTransfer ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> o = Voicemail ( skype , object_id ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , o , str ( value ) ) <EOL> elif a in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> object_type , object_id , prop_name , value = [ a , '<STR_LIT>' ] + chop ( b ) <EOL> skype . _CacheDict [ str ( object_type ) , str ( object_id ) , str ( prop_name ) ] = value <EOL> elif a in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> object_type , object_id , prop_name , value = [ a , '<STR_LIT>' , '<STR_LIT>' , b ] <EOL> skype . _CacheDict [ str ( object_type ) , str ( object_id ) , str ( prop_name ) ] = value <EOL> if object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , value == '<STR_LIT>' ) <EOL> elif object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , ( value == '<STR_LIT>' ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , str ( value ) ) <EOL> elif object_type == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , ( value == '<STR_LIT>' ) ) <EOL> elif a == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' ) <EOL> elif a == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> elif a == '<STR_LIT>' : <EOL> prop_name , value = chop ( b ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , str ( value ) ) <EOL> elif a == '<STR_LIT>' : <EOL> prop_name , value = chop ( b ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , int ( value ) ) <EOL> elif a == '<STR_LIT>' : <EOL> object_id , prop_name , value = chop ( b , <NUM_LIT:2> ) <EOL> if prop_name == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , PluginEvent ( skype , object_id ) ) <EOL> elif a == '<STR_LIT>' : <EOL> object_id , prop_name , value = chop ( b , <NUM_LIT:2> ) <EOL> if prop_name == '<STR_LIT>' : <EOL> i = value . rfind ( '<STR_LIT>' ) <EOL> if i >= <NUM_LIT:0> : <EOL> context = chop ( value [ i + <NUM_LIT:8> : ] ) [ <NUM_LIT:0> ] <EOL> users = ( ) <EOL> context_id = u'<STR_LIT>' <EOL> if context in ( pluginContextContact , pluginContextCall , pluginContextChat ) : <EOL> users = UserCollection ( skype , split ( value [ : i - <NUM_LIT:1> ] , '<STR_LIT:U+002CU+0020>' ) ) <EOL> if context in ( pluginContextCall , pluginContextChat ) : <EOL> j = value . rfind ( '<STR_LIT>' ) <EOL> if j >= <NUM_LIT:0> : <EOL> context_id = str ( chop ( value [ j + <NUM_LIT:11> : ] ) [ <NUM_LIT:0> ] ) <EOL> if context == pluginContextCall : <EOL> context_id = int ( context_id ) <EOL> skype . _CallEventHandler ( '<STR_LIT>' , PluginMenuItem ( skype , object_id ) , users , str ( context ) , context_id ) <EOL> elif a == '<STR_LIT>' : <EOL> skype . _CallEventHandler ( '<STR_LIT>' , unicode2path ( b ) ) <EOL> except weakref . ReferenceError : <EOL> pass <EOL> def sending_command ( self , command ) : <EOL> try : <EOL> self . skype . _CallEventHandler ( '<STR_LIT>' , command ) <EOL> except weakref . ReferenceError : <EOL> pass <EOL> def reply_received ( self , command ) : <EOL> try : <EOL> self . skype . _CallEventHandler ( '<STR_LIT>' , command ) <EOL> except weakref . ReferenceError : <EOL> pass <EOL> class Skype ( EventHandlingBase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , Events = None , ** Options ) : <EOL> """<STR_LIT>""" <EOL> self . _Logger = logging . getLogger ( '<STR_LIT>' ) <EOL> self . _Logger . info ( '<STR_LIT>' ) <EOL> EventHandlingBase . __init__ ( self ) <EOL> if Events : <EOL> self . _SetEventHandlerObject ( Events ) <EOL> try : <EOL> self . _Api = Options . pop ( '<STR_LIT>' ) <EOL> if Options : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> except KeyError : <EOL> self . _Api = SkypeAPI ( Options ) <EOL> self . _Api . set_notifier ( APINotifier ( self ) ) <EOL> Cached . _CreateOwner ( self ) <EOL> self . _Cache = True <EOL> self . ResetCache ( ) <EOL> from api import DEFAULT_TIMEOUT <EOL> self . _Timeout = DEFAULT_TIMEOUT <EOL> self . _Convert = Conversion ( self ) <EOL> self . _Client = Client ( self ) <EOL> self . _Settings = Settings ( self ) <EOL> self . _Profile = Profile ( self ) <EOL> def __del__ ( self ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> self . _Api . close ( ) <EOL> self . _Logger . info ( '<STR_LIT>' ) <EOL> def _DoCommand ( self , Cmd , ExpectedReply = '<STR_LIT>' ) : <EOL> command = Command ( Cmd , ExpectedReply , True , self . Timeout ) <EOL> self . SendCommand ( command ) <EOL> a , b = chop ( command . Reply ) <EOL> if a == '<STR_LIT>' : <EOL> errnum , errstr = chop ( b ) <EOL> self . _CallEventHandler ( '<STR_LIT>' , command , int ( errnum ) , errstr ) <EOL> raise SkypeError ( int ( errnum ) , errstr ) <EOL> if not command . Reply . startswith ( command . Expected ) : <EOL> raise SkypeError ( <NUM_LIT:0> , '<STR_LIT>' % ( command . Reply , command . Expected ) ) <EOL> return command . Reply <EOL> def _Property ( self , ObjectType , ObjectId , PropName , Set = None , Cache = True ) : <EOL> h = ( str ( ObjectType ) , str ( ObjectId ) , str ( PropName ) ) <EOL> arg = ( '<STR_LIT>' % h ) . split ( ) <EOL> while '<STR_LIT>' in arg : <EOL> arg . remove ( '<STR_LIT>' ) <EOL> jarg = '<STR_LIT:U+0020>' . join ( arg ) <EOL> if Set is None : <EOL> if Cache and self . _Cache and h in self . _CacheDict : <EOL> return self . _CacheDict [ h ] <EOL> value = self . _DoCommand ( '<STR_LIT>' % jarg , jarg ) <EOL> while arg : <EOL> try : <EOL> a , b = chop ( value ) <EOL> except ValueError : <EOL> break <EOL> if a . lower ( ) != arg [ <NUM_LIT:0> ] . lower ( ) : <EOL> break <EOL> del arg [ <NUM_LIT:0> ] <EOL> value = b <EOL> if Cache and self . _Cache : <EOL> self . _CacheDict [ h ] = value <EOL> return value <EOL> else : <EOL> value = unicode ( Set ) <EOL> self . _DoCommand ( '<STR_LIT>' % ( jarg , value ) , jarg ) <EOL> if Cache and self . _Cache : <EOL> self . _CacheDict [ h ] = value <EOL> def _Alter ( self , ObjectType , ObjectId , AlterName , Args = None , Reply = None ) : <EOL> cmd = '<STR_LIT>' % ( str ( ObjectType ) , str ( ObjectId ) , str ( AlterName ) ) <EOL> if Reply is None : <EOL> Reply = cmd <EOL> if Args is not None : <EOL> cmd = '<STR_LIT>' % ( cmd , tounicode ( Args ) ) <EOL> reply = self . _DoCommand ( cmd , Reply ) <EOL> arg = cmd . split ( ) <EOL> while arg : <EOL> try : <EOL> a , b = chop ( reply ) <EOL> except ValueError : <EOL> break <EOL> if a . lower ( ) != arg [ <NUM_LIT:0> ] . lower ( ) : <EOL> break <EOL> del arg [ <NUM_LIT:0> ] <EOL> reply = b <EOL> return reply <EOL> def _Search ( self , ObjectType , Args = None ) : <EOL> cmd = '<STR_LIT>' % ObjectType <EOL> if Args is not None : <EOL> cmd = '<STR_LIT>' % ( cmd , Args ) <EOL> return split ( chop ( str ( self . _DoCommand ( cmd ) ) ) [ - <NUM_LIT:1> ] , '<STR_LIT:U+002CU+0020>' ) <EOL> def ApiSecurityContextEnabled ( self , Context ) : <EOL> """<STR_LIT>""" <EOL> self . _Api . security_context_enabled ( Context ) <EOL> def Application ( self , Name ) : <EOL> """<STR_LIT>""" <EOL> return Application ( self , Name ) <EOL> def _AsyncSearchUsersReplyHandler ( self , Command ) : <EOL> if Command in self . _AsyncSearchUsersCommands : <EOL> self . _AsyncSearchUsersCommands . remove ( Command ) <EOL> self . _CallEventHandler ( '<STR_LIT>' , Command . Id , <EOL> UserCollection ( self , split ( chop ( Command . Reply ) [ - <NUM_LIT:1> ] , '<STR_LIT:U+002CU+0020>' ) ) ) <EOL> if len ( self . _AsyncSearchUsersCommands ) == <NUM_LIT:0> : <EOL> self . UnregisterEventHandler ( '<STR_LIT>' , self . _AsyncSearchUsersReplyHandler ) <EOL> del self . _AsyncSearchUsersCommands <EOL> def AsyncSearchUsers ( self , Target ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( self , '<STR_LIT>' ) : <EOL> self . _AsyncSearchUsersCommands = [ ] <EOL> self . RegisterEventHandler ( '<STR_LIT>' , self . _AsyncSearchUsersReplyHandler ) <EOL> command = Command ( '<STR_LIT>' % tounicode ( Target ) , '<STR_LIT>' , False , self . Timeout ) <EOL> self . _AsyncSearchUsersCommands . append ( command ) <EOL> self . SendCommand ( command ) <EOL> return command . Id <EOL> def Attach ( self , Protocol = <NUM_LIT:5> , Wait = True ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> self . _Api . protocol = Protocol <EOL> self . _Api . attach ( self . Timeout , Wait ) <EOL> except SkypeAPIError : <EOL> self . ResetCache ( ) <EOL> raise <EOL> def Call ( self , Id = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> o = Call ( self , Id ) <EOL> o . Status <EOL> return o <EOL> def Calls ( self , Target = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return CallCollection ( self , self . _Search ( '<STR_LIT>' , Target ) ) <EOL> def _ChangeUserStatus_UserStatus ( self , Status ) : <EOL> if Status . upper ( ) == self . _ChangeUserStatus_Status : <EOL> self . _ChangeUserStatus_Event . set ( ) <EOL> def ChangeUserStatus ( self , Status ) : <EOL> """<STR_LIT>""" <EOL> if self . CurrentUserStatus . upper ( ) == Status . upper ( ) : <EOL> return <EOL> self . _ChangeUserStatus_Event = threading . Event ( ) <EOL> self . _ChangeUserStatus_Status = Status . upper ( ) <EOL> self . RegisterEventHandler ( '<STR_LIT>' , self . _ChangeUserStatus_UserStatus ) <EOL> self . CurrentUserStatus = Status <EOL> self . _ChangeUserStatus_Event . wait ( ) <EOL> self . UnregisterEventHandler ( '<STR_LIT>' , self . _ChangeUserStatus_UserStatus ) <EOL> del self . _ChangeUserStatus_Event , self . _ChangeUserStatus_Status <EOL> def Chat ( self , Name = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> o = Chat ( self , Name ) <EOL> o . Status <EOL> return o <EOL> def ClearCallHistory ( self , Username = '<STR_LIT>' , Type = chsAllCalls ) : <EOL> """<STR_LIT>""" <EOL> cmd = '<STR_LIT>' % ( str ( Type ) , Username ) <EOL> self . _DoCommand ( cmd , cmd ) <EOL> def ClearChatHistory ( self ) : <EOL> """<STR_LIT>""" <EOL> cmd = '<STR_LIT>' <EOL> self . _DoCommand ( cmd , cmd ) <EOL> def ClearVoicemailHistory ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _DoCommand ( '<STR_LIT>' ) <EOL> def Command ( self , Command , Reply = u'<STR_LIT>' , Block = False , Timeout = <NUM_LIT> , Id = - <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> from api import Command as CommandClass <EOL> return CommandClass ( Command , Reply , Block , Timeout , Id ) <EOL> def Conference ( self , Id = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> o = Conference ( self , Id ) <EOL> if Id <= <NUM_LIT:0> or not o . Calls : <EOL> raise SkypeError ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> return o <EOL> def CreateChatUsingBlob ( self , Blob ) : <EOL> """<STR_LIT>""" <EOL> return Chat ( self , chop ( self . _DoCommand ( '<STR_LIT>' % Blob ) , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> def CreateChatWith ( self , * Usernames ) : <EOL> """<STR_LIT>""" <EOL> return Chat ( self , chop ( self . _DoCommand ( '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( Usernames ) ) , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> def CreateGroup ( self , GroupName ) : <EOL> """<STR_LIT>""" <EOL> groups = self . CustomGroups <EOL> self . _DoCommand ( '<STR_LIT>' % tounicode ( GroupName ) ) <EOL> for g in self . CustomGroups : <EOL> if g not in groups and g . DisplayName == GroupName : <EOL> return g <EOL> raise SkypeError ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> def CreateSms ( self , MessageType , * TargetNumbers ) : <EOL> """<STR_LIT>""" <EOL> return SmsMessage ( self , chop ( self . _DoCommand ( '<STR_LIT>' % ( MessageType , '<STR_LIT:U+002CU+0020>' . join ( TargetNumbers ) ) ) , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> def DeleteGroup ( self , GroupId ) : <EOL> """<STR_LIT>""" <EOL> self . _DoCommand ( '<STR_LIT>' % GroupId ) <EOL> def EnableApiSecurityContext ( self , Context ) : <EOL> """<STR_LIT>""" <EOL> self . _Api . enable_security_context ( Context ) <EOL> def FindChatUsingBlob ( self , Blob ) : <EOL> """<STR_LIT>""" <EOL> return Chat ( self , chop ( self . _DoCommand ( '<STR_LIT>' % Blob ) , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> def Greeting ( self , Username = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> for v in self . Voicemails : <EOL> if Username and v . PartnerHandle != Username : <EOL> continue <EOL> if v . Type in ( vmtDefaultGreeting , vmtCustomGreeting ) : <EOL> return v <EOL> def Message ( self , Id = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> o = ChatMessage ( self , Id ) <EOL> o . Status <EOL> return o <EOL> def Messages ( self , Target = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return ChatMessageCollection ( self , self . _Search ( '<STR_LIT>' , Target ) ) <EOL> def PlaceCall ( self , * Targets ) : <EOL> """<STR_LIT>""" <EOL> calls = self . ActiveCalls <EOL> reply = self . _DoCommand ( '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( Targets ) ) <EOL> if reply . startswith ( '<STR_LIT>' ) : <EOL> return Call ( self , chop ( reply , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> for c in self . ActiveCalls : <EOL> if c not in calls : <EOL> return c <EOL> raise SkypeError ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> def Privilege ( self , Name ) : <EOL> """<STR_LIT>""" <EOL> return ( self . _Property ( '<STR_LIT>' , '<STR_LIT>' , Name . upper ( ) ) == '<STR_LIT>' ) <EOL> def Profile ( self , Property , Set = None ) : <EOL> """<STR_LIT>""" <EOL> return self . _Property ( '<STR_LIT>' , '<STR_LIT>' , Property , Set ) <EOL> def Property ( self , ObjectType , ObjectId , PropName , Set = None ) : <EOL> """<STR_LIT>""" <EOL> return self . _Property ( ObjectType , ObjectId , PropName , Set ) <EOL> def ResetCache ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _CacheDict = { } <EOL> def SearchForUsers ( self , Target ) : <EOL> """<STR_LIT>""" <EOL> return UserCollection ( self , self . _Search ( '<STR_LIT>' , tounicode ( Target ) ) ) <EOL> def SendCommand ( self , Command ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> self . _Api . send_command ( Command ) <EOL> except SkypeAPIError : <EOL> self . ResetCache ( ) <EOL> raise <EOL> def SendMessage ( self , Username , Text ) : <EOL> """<STR_LIT>""" <EOL> return self . CreateChatWith ( Username ) . SendMessage ( Text ) <EOL> def SendSms ( self , * TargetNumbers , ** Properties ) : <EOL> """<STR_LIT>""" <EOL> sms = self . CreateSms ( smsMessageTypeOutgoing , * TargetNumbers ) <EOL> for name , value in Properties . items ( ) : <EOL> if isinstance ( getattr ( sms . __class__ , name , None ) , property ) : <EOL> setattr ( sms , name , value ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' % prop ) <EOL> sms . Send ( ) <EOL> return sms <EOL> def SendVoicemail ( self , Username ) : <EOL> """<STR_LIT>""" <EOL> if self . _Api . protocol >= <NUM_LIT:6> : <EOL> self . _DoCommand ( '<STR_LIT>' % Username ) <EOL> else : <EOL> self . _DoCommand ( '<STR_LIT>' % Username ) <EOL> def User ( self , Username = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> if not Username : <EOL> Username = self . CurrentUserHandle <EOL> o = User ( self , Username ) <EOL> o . OnlineStatus <EOL> return o <EOL> def Variable ( self , Name , Set = None ) : <EOL> """<STR_LIT>""" <EOL> return self . _Property ( Name , '<STR_LIT>' , '<STR_LIT>' , Set ) <EOL> def Voicemail ( self , Id ) : <EOL> """<STR_LIT>""" <EOL> o = Voicemail ( self , Id ) <EOL> o . Type <EOL> return o <EOL> def _GetActiveCalls ( self ) : <EOL> return CallCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> ActiveCalls = property ( _GetActiveCalls , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetActiveChats ( self ) : <EOL> return ChatCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> ActiveChats = property ( _GetActiveChats , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetActiveFileTransfers ( self ) : <EOL> return FileTransferCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> ActiveFileTransfers = property ( _GetActiveFileTransfers , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetApiWrapperVersion ( self ) : <EOL> import pkg_resources <EOL> return pkg_resources . get_distribution ( "<STR_LIT>" ) . version <EOL> ApiWrapperVersion = property ( _GetApiWrapperVersion , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetAttachmentStatus ( self ) : <EOL> return self . _Api . attachment_status <EOL> AttachmentStatus = property ( _GetAttachmentStatus , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetBookmarkedChats ( self ) : <EOL> return ChatCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> BookmarkedChats = property ( _GetBookmarkedChats , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCache ( self ) : <EOL> return self . _Cache <EOL> def _SetCache ( self , Value ) : <EOL> self . _Cache = bool ( Value ) <EOL> Cache = property ( _GetCache , _SetCache , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetChats ( self ) : <EOL> return ChatCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> Chats = property ( _GetChats , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetClient ( self ) : <EOL> return self . _Client <EOL> Client = property ( _GetClient , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCommandId ( self ) : <EOL> return True <EOL> def _SetCommandId ( self , Value ) : <EOL> if not Value : <EOL> raise SkypeError ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> CommandId = property ( _GetCommandId , _SetCommandId , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetConferences ( self ) : <EOL> cids = [ ] <EOL> for c in self . Calls ( ) : <EOL> cid = c . ConferenceId <EOL> if cid > <NUM_LIT:0> and cid not in cids : <EOL> cids . append ( cid ) <EOL> return ConferenceCollection ( self , cids ) <EOL> Conferences = property ( _GetConferences , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetConnectionStatus ( self ) : <EOL> return str ( self . Variable ( '<STR_LIT>' ) ) <EOL> ConnectionStatus = property ( _GetConnectionStatus , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetConvert ( self ) : <EOL> return self . _Convert <EOL> Convert = property ( _GetConvert , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCurrentUser ( self ) : <EOL> return User ( self , self . CurrentUserHandle ) <EOL> CurrentUser = property ( _GetCurrentUser , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCurrentUserHandle ( self ) : <EOL> return str ( self . Variable ( '<STR_LIT>' ) ) <EOL> CurrentUserHandle = property ( _GetCurrentUserHandle , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCurrentUserProfile ( self ) : <EOL> return self . _Profile <EOL> CurrentUserProfile = property ( _GetCurrentUserProfile , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCurrentUserStatus ( self ) : <EOL> return str ( self . Variable ( '<STR_LIT>' ) ) <EOL> def _SetCurrentUserStatus ( self , Value ) : <EOL> self . Variable ( '<STR_LIT>' , str ( Value ) ) <EOL> CurrentUserStatus = property ( _GetCurrentUserStatus , _SetCurrentUserStatus , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetCustomGroups ( self ) : <EOL> return GroupCollection ( self , self . _Search ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> CustomGroups = property ( _GetCustomGroups , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetFileTransfers ( self ) : <EOL> return FileTransferCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> FileTransfers = property ( _GetFileTransfers , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetFocusedContacts ( self ) : <EOL> return UserCollection ( self , split ( chop ( self . _DoCommand ( '<STR_LIT>' , '<STR_LIT>' ) , <NUM_LIT:2> ) [ - <NUM_LIT:1> ] ) ) <EOL> FocusedContacts = property ( _GetFocusedContacts , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetFriendlyName ( self ) : <EOL> return self . _Api . friendly_name <EOL> def _SetFriendlyName ( self , Value ) : <EOL> self . _Api . set_friendly_name ( tounicode ( Value ) ) <EOL> FriendlyName = property ( _GetFriendlyName , _SetFriendlyName , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetFriends ( self ) : <EOL> return UserCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> Friends = property ( _GetFriends , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetGroups ( self ) : <EOL> return GroupCollection ( self , self . _Search ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> Groups = property ( _GetGroups , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetHardwiredGroups ( self ) : <EOL> return GroupCollection ( self , self . _Search ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> HardwiredGroups = property ( _GetHardwiredGroups , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMissedCalls ( self ) : <EOL> return CallCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> MissedCalls = property ( _GetMissedCalls , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMissedChats ( self ) : <EOL> return ChatCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> MissedChats = property ( _GetMissedChats , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMissedMessages ( self ) : <EOL> return ChatMessageCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> MissedMessages = property ( _GetMissedMessages , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMissedSmss ( self ) : <EOL> return SmsMessageCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> MissedSmss = property ( _GetMissedSmss , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMissedVoicemails ( self ) : <EOL> return VoicemailCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> MissedVoicemails = property ( _GetMissedVoicemails , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetMute ( self ) : <EOL> return self . Variable ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def _SetMute ( self , Value ) : <EOL> self . Variable ( '<STR_LIT>' , cndexp ( Value , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> Mute = property ( _GetMute , _SetMute , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetPredictiveDialerCountry ( self ) : <EOL> return str ( self . Variable ( '<STR_LIT>' ) ) <EOL> PredictiveDialerCountry = property ( _GetPredictiveDialerCountry , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetProtocol ( self ) : <EOL> return self . _Api . protocol <EOL> def _SetProtocol ( self , Value ) : <EOL> self . _DoCommand ( '<STR_LIT>' % Value ) <EOL> self . _Api . protocol = int ( Value ) <EOL> Protocol = property ( _GetProtocol , _SetProtocol , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetRecentChats ( self ) : <EOL> return ChatCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> RecentChats = property ( _GetRecentChats , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetSettings ( self ) : <EOL> return self . _Settings <EOL> Settings = property ( _GetSettings , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetSilentMode ( self ) : <EOL> return self . _Property ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , Cache = False ) == '<STR_LIT>' <EOL> def _SetSilentMode ( self , Value ) : <EOL> self . _Property ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , cndexp ( Value , '<STR_LIT>' , '<STR_LIT>' ) , Cache = False ) <EOL> SilentMode = property ( _GetSilentMode , _SetSilentMode , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetSmss ( self ) : <EOL> return SmsMessageCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> Smss = property ( _GetSmss , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetTimeout ( self ) : <EOL> return self . _Timeout <EOL> def _SetTimeout ( self , Value ) : <EOL> if not isinstance ( Value , ( int , long , float ) ) : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> repr ( type ( Value ) ) ) <EOL> self . _Timeout = Value <EOL> Timeout = property ( _GetTimeout , _SetTimeout , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetUsersWaitingAuthorization ( self ) : <EOL> return UserCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> UsersWaitingAuthorization = property ( _GetUsersWaitingAuthorization , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetVersion ( self ) : <EOL> return str ( self . Variable ( '<STR_LIT>' ) ) <EOL> Version = property ( _GetVersion , <EOL> doc = """<STR_LIT>""" ) <EOL> def _GetVoicemails ( self ) : <EOL> return VoicemailCollection ( self , self . _Search ( '<STR_LIT>' ) ) <EOL> Voicemails = property ( _GetVoicemails , <EOL> doc = """<STR_LIT>""" ) <EOL> class SkypeEvents ( object ) : <EOL> """<STR_LIT>""" <EOL> def ApplicationConnecting ( self , App , Users ) : <EOL> """<STR_LIT>""" <EOL> def ApplicationDatagram ( self , App , Stream , Text ) : <EOL> """<STR_LIT>""" <EOL> def ApplicationReceiving ( self , App , Streams ) : <EOL> """<STR_LIT>""" <EOL> def ApplicationSending ( self , App , Streams ) : <EOL> """<STR_LIT>""" <EOL> def ApplicationStreams ( self , App , Streams ) : <EOL> """<STR_LIT>""" <EOL> def AsyncSearchUsersFinished ( self , Cookie , Users ) : <EOL> """<STR_LIT>""" <EOL> def AttachmentStatus ( self , Status ) : <EOL> """<STR_LIT>""" <EOL> def AutoAway ( self , Automatic ) : <EOL> """<STR_LIT>""" <EOL> def CallDtmfReceived ( self , Call , Code ) : <EOL> """<STR_LIT>""" <EOL> def CallHistory ( self ) : <EOL> """<STR_LIT>""" <EOL> def CallInputStatusChanged ( self , Call , Active ) : <EOL> """<STR_LIT>""" <EOL> def CallSeenStatusChanged ( self , Call , Seen ) : <EOL> """<STR_LIT>""" <EOL> def CallStatus ( self , Call , Status ) : <EOL> """<STR_LIT>""" <EOL> def CallTransferStatusChanged ( self , Call , Status ) : <EOL> """<STR_LIT>""" <EOL> def CallVideoReceiveStatusChanged ( self , Call , Status ) : <EOL> """<STR_LIT>""" <EOL> def CallVideoSendStatusChanged ( self , Call , Status ) : <EOL> """<STR_LIT>""" <EOL> def CallVideoStatusChanged ( self , Call , Status ) : <EOL> """<STR_LIT>""" <EOL> def ChatMemberRoleChanged ( self , Member , Role ) : <EOL> """<STR_LIT>""" <EOL> def ChatMembersChanged ( self , Chat , Members ) : <EOL> """<STR_LIT>""" <EOL> def ChatWindowState ( self , Chat , State ) : <EOL> """<STR_LIT>""" <EOL> def ClientWindowState ( self , State ) : <EOL> """<STR_LIT>""" <EOL> def Command ( self , command ) : <EOL> """<STR_LIT>""" <EOL> def ConnectionStatus ( self , Status ) : <EOL> """<STR_LIT>""" <EOL> def ContactsFocused ( self , Username ) : <EOL> """<STR_LIT>""" <EOL> def Error ( self , command , Number , Description ) : <EOL> """<STR_LIT>""" <EOL> def FileTransferStatusChanged ( self , Transfer , Status ) : <EOL> """<STR_LIT>""" <EOL> def GroupDeleted ( self , GroupId ) : <EOL> """<STR_LIT>""" <EOL> def GroupExpanded ( self , Group , Expanded ) : <EOL> """<STR_LIT>""" <EOL> def GroupUsers ( self , Group , Count ) : <EOL> """<STR_LIT>""" <EOL> def GroupVisible ( self , Group , Visible ) : <EOL> """<STR_LIT>""" <EOL> def MessageHistory ( self , Username ) : <EOL> """<STR_LIT>""" <EOL> def MessageStatus ( self , Message , Status ) : <EOL> """<STR_LIT>""" <EOL> def Mute ( self , Mute ) : <EOL> """<STR_LIT>""" <EOL> def Notify ( self , Notification ) : <EOL> """<STR_LIT>""" <EOL> def OnlineStatus ( self , User , Status ) : <EOL> """<STR_LIT>""" <EOL> def PluginEventClicked ( self , Event ) : <EOL> """<STR_LIT>""" <EOL> def PluginMenuItemClicked ( self , MenuItem , Users , PluginContext , ContextId ) : <EOL> """<STR_LIT>""" <EOL> def Reply ( self , command ) : <EOL> """<STR_LIT>""" <EOL> def SilentModeStatusChanged ( self , Silent ) : <EOL> """<STR_LIT>""" <EOL> def SmsMessageStatusChanged ( self , Message , Status ) : <EOL> """<STR_LIT>""" <EOL> def SmsTargetStatusChanged ( self , Target , Status ) : <EOL> """<STR_LIT>""" <EOL> def UserAuthorizationRequestReceived ( self , User ) : <EOL> """<STR_LIT>""" <EOL> def UserMood ( self , User , MoodText ) : <EOL> """<STR_LIT>""" <EOL> def UserStatus ( self , Status ) : <EOL> """<STR_LIT>""" <EOL> def VoicemailStatus ( self , Mail , Status ) : <EOL> """<STR_LIT>""" <EOL> def WallpaperChanged ( self , Path ) : <EOL> """<STR_LIT>""" <EOL> Skype . _AddEvents ( SkypeEvents ) </s>
