request2doc_gui.py 文件源码

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

项目:request2doc 作者: kongxinchi 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号