def dialog_select(self, heading, list):
ID = "%032x" %(random.getrandbits(128))
response = '<?xml version="1.0" encoding="UTF-8" ?>\n'
response +='<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">\n'
response +='<channel>\n'
response +='<link>/rss</link>\n'
response +='<title>'+heading+'</title>\n'
for option in list:
response += '<item>\n'
response += '<title>'+option +'</title>\n'
response += '<image>%s</image>\n'
response += '<link>http://'+self.controller.host+'/data/'+threading.current_thread().name +'/'+ID+'/'+str(list.index(option))+'</link>\n'
response += '</item>\n\n'
response += '</channel>\n'
response += '</rss>\n'
self.controller.send_data(response)
self.handler.server.shutdown_request(self.handler.request)
while not self.controller.get_data(ID):
continue
return int(self.controller.get_data(ID))
评论列表
文章目录