AutoTimerResource.py 文件源码

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

项目:enigma2-plugins 作者: opendreambox 项目源码 文件源码
def run(self):
        req = self._req
        if self._stillAlive:
            req.setResponseCode(http.OK)
            req.setHeader('Content-type', 'application/xhtml+xml')
            req.setHeader('charset', 'UTF-8')
            reactor.callFromThread(lambda: req.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<e2autotimersimulate api_version=\"" + str(API_VERSION) + "\">\n"))

        def finishRequest():
            req.write('</e2autotimersimulate>')
            req.finish()

        try: autotimer.parseEPG(simulateOnly=True, callback=self.intermediateWrite)
        except Exception as e:
            def finishRequest():
                req.write('<exception>'+str(e)+'</exception><|PURPOSEFULLYBROKENXML<')
                req.finish()

        if self._stillAlive:
            reactor.callFromThread(finishRequest)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号