upnpService.py 文件源码

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

项目:pyfeld 作者: scjurgen 项目源码 文件源码
def get_services_from_location(location):
        try:
            (xml_headers, xml_data) = UpnpSoap.get(location)
            if xml_data is not False:
                xml_root = minidom.parseString(xml_data)
                services_list = list()
                for service in xml_root.getElementsByTagName("service"):
                    service_dict = XmlHelper.xml_extract_dict(service, ['serviceType',
                                                                   'controlURL',
                                                                   'eventSubURL',
                                                                   'SCPDURL',
                                                                   'serviceId'])
                    services_list.append(service_dict)
                return services_list
        except Exception as e:
            print("Error get_subscription_urls:{0}".format(e))
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号