本文整理汇总了Python中ui.Ui.main方法的典型用法代码示例。如果您正苦于以下问题:Python Ui.main方法的具体用法?Python Ui.main怎么用?Python Ui.main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui.Ui
的用法示例。
在下文中一共展示了Ui.main方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InkTex
# 需要导入模块: from ui import Ui [as 别名]
# 或者: from ui.Ui import main [as 别名]
class InkTex(inkex.Effect):
"""
Our main class, derived from inkex.Effect. It wraps the other classes and
implements the effect() function.
"""
def __init__(self):
inkex.Effect.__init__(self)
# the original (i.e., selected) svg element and the newly created one
# including the original LaTeX source.
self.orig = None
self.orig_src = None
self.new = None
self.new_src = None
def effect(self):
"""If there is an original element, store it. Open the GUI."""
self.orig, self.orig_src = self.get_original()
self.ui = Ui(self.render, self.orig_src, self.get_settings())
self.ui.main()
def render(self, tex, settings):
"""Execute the rendering and, upon errors, send them to the UI"""
self.new_src = tex
self.store_settings(settings)
with Converter(self) as renderer:
try:
self.new = renderer.render(self.new_src, settings)
self.copy_styles()
self.store_src_information()
self.append_or_replace()
return True
except Exception, e:
self.ui.log(e.message)