Bonjour.py 文件源码

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

项目:enigma2-plugins 作者: opendreambox 项目源码 文件源码
def __parse(self, file):
        print "[Bonjour.__parse] parsing %s%s" %(self.AVAHI_SERVICES_DIR, file)
        try:
            config = cet_parse(self.AVAHI_SERVICES_DIR + file).getroot()
        except ParseError: #parsing failed, skip the file
            return

        name = config.find('name').text

        service = config.find('service')
        type = service.find('type').text
        port = service.find('port').text
        text = service.findall('txt-record')
        textList = []
        if text != None:
            for txt in text:
                textList.append(txt.text)

        service = self.buildServiceFull(file, name, type, port, textList)
        self.registerService(service)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号