本文整理汇总了Python中preferences.Preferences.init方法的典型用法代码示例。如果您正苦于以下问题:Python Preferences.init方法的具体用法?Python Preferences.init怎么用?Python Preferences.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类preferences.Preferences
的用法示例。
在下文中一共展示了Preferences.init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_hook
# 需要导入模块: from preferences import Preferences [as 别名]
# 或者: from preferences.Preferences import init [as 别名]
markdowner.on_focus_gained()
self.web.setFocus()
self.web.eval("focusField(%d);" % self.currentField)
note.tags = tags
try:
time.sleep(0.001)
self.updateTags()
except AttributeError as e:
print e # TODO: log error
utility.end_safe_block(const.MARKDOWN_PREFS)
def init_hook(self, mw, widget, parentWindow, addMode=False):
addHook("editFocusGained", self.on_focus_gained)
Preferences.init()
if preferences.PREFS.get(const.MARKDOWN):
editor.Editor.on_focus_gained = on_focus_gained
editor.Editor.__init__ = wrap(editor.Editor.__init__, init_hook)
editor.Editor.create_button = create_button
editor.Editor.toggleMarkdown = toggleMarkdown
editor.Editor.toggleHeading = toggleHeading
editor.Editor.toggleAbbreviation = toggleAbbreviation
editor.Editor.toggleHyperlink = toggleHyperlink
editor.Editor.remove_garbage = remove_garbage
editor.Editor.unlink = unlink
editor.Editor.justifyFull = justifyFull
editor.Editor.justifyRight = justifyRight
editor.Editor.justifyLeft = justifyLeft