def on_transform_button_click(self, event):
slice_startswith = self.slice_text.GetValue()
template_path = self.get_template_path()
response_body = self.GetParent().get_response_content()
try:
handler = Request2Doc()
handler.set_slice_startswith(slice_startswith)
handler.set_response_body(response_body)
if not handler.get_response_data():
return wx.MessageDialog(None, u'Response body is not legal format', u"Information", wx.OK | wx.ICON_INFORMATION).ShowModal()
self.GetParent().set_document_content(handler.render_string(template_path))
except Exception, e:
return wx.MessageDialog(None, traceback.format_exc(), u"Exception", wx.OK | wx.ICON_ERROR).ShowModal()
评论列表
文章目录