addon.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SkypeKodi 作者: olixelle 项目源码 文件源码
def checkCallStatus( name, skypeWindow ):
    time.sleep(10)
    filePath = __addon__.getSetting( 'skypexmlcontroller_var_path') + "skype2kodi\\call.xml"
    while __windowopen__ and (not xbmc.abortRequested):
        if os.path.isfile(filePath):
            from xml.dom import minidom
            xmldoc = minidom.parse(filePath)
            friendName = xmldoc.getElementsByTagName('name')[0].childNodes[0].nodeValue
            friendAvatar = xmldoc.getElementsByTagName('avatar')[0].childNodes[0].nodeValue
            callStatus = xmldoc.getElementsByTagName('status')[0].childNodes[0].nodeValue
            xbmc.log("Skype : call status is " + callStatus + " with " + friendName)

            if (callStatus == 'incoming'):
                wRinging.ringing(friendName, friendAvatar, 'incoming')
                #xbmc.executebuiltin('Notification(Skype,' + friendName + ' is calling !, 1000, ' + friendAvatar + ')')

            if (callStatus == 'outgoing'):
                wRinging.ringing(friendName, friendAvatar, 'outgoing')
                #xbmc.executebuiltin('Notification(Skype, Calling ' + friendName + ', 1000, ' + friendAvatar + ')')

            #if (callStatus == 'active'):
            #   xbmc.executebuiltin('Notification(Skype, Call active with ' + friendName + ', 1000, ' + friendAvatar + ')')

            if (callStatus == 'finished'):
                wRinging.close()
                os.remove(filePath)
                xbmc.executebuiltin('Notification(Skype, Call finished with ' + friendName + ', 3000, ' + friendAvatar + ')')


        time.sleep(2)

#---------------------------------------------------------------------------------------------------------------------
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号