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)
评论列表
文章目录