本文整理汇总了Python中outwiker.core.application.Application.onHtmlRenderingBegin方法的典型用法代码示例。如果您正苦于以下问题:Python Application.onHtmlRenderingBegin方法的具体用法?Python Application.onHtmlRenderingBegin怎么用?Python Application.onHtmlRenderingBegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类outwiker.core.application.Application
的用法示例。
在下文中一共展示了Application.onHtmlRenderingBegin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _onSwitchCodeHtml
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import onHtmlRenderingBegin [as 别名]
def _onSwitchCodeHtml (self):
assert self._currentpage != None
self.Save()
status_item = 0
setStatusText (_(u"Page rendered. Please wait…"), status_item)
Application.onHtmlRenderingBegin (self._currentpage, self.htmlWindow)
try:
self.currentHtmlFile = self.generateHtml (self._currentpage)
self._showHtmlCode(self.currentHtmlFile)
except IOError as e:
# TODO: Проверить под Windows
MessageBox (_(u"Can't save file %s") % (unicode (e.filename)),
_(u"Error"),
wx.ICON_ERROR | wx.OK)
except OSError as e:
MessageBox (_(u"Can't save HTML-file\n\n%s") % (unicode (e)),
_(u"Error"),
wx.ICON_ERROR | wx.OK)
setStatusText (u"", status_item)
Application.onHtmlRenderingEnd (self._currentpage, self.htmlWindow)
self._enableAllTools ()
self.htmlCodeWindow.SetFocus()
self.htmlCodeWindow.Update()
示例2: _showHtml
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import onHtmlRenderingBegin [as 别名]
def _showHtml (self):
"""
Подготовить и показать HTML текущей страницы
"""
assert self._currentpage != None
status_item = 0
setStatusText (_(u"Page rendered. Please wait…"), status_item)
Application.onHtmlRenderingBegin (self._currentpage, self.htmlWindow)
try:
self.currentHtmlFile = self.generateHtml (self._currentpage)
self.htmlWindow.LoadPage (self.currentHtmlFile)
except IOError as e:
# TODO: Проверить под Windows
MessageBox (_(u"Can't save file %s") % (unicode (e.filename)),
_(u"Error"),
wx.ICON_ERROR | wx.OK)
except OSError as e:
MessageBox (_(u"Can't save HTML-file\n\n%s") % (unicode (e)),
_(u"Error"),
wx.ICON_ERROR | wx.OK)
setStatusText (u"", status_item)
Application.onHtmlRenderingEnd (self._currentpage, self.htmlWindow)