本文整理汇总了Python中dragonfly.Config.tweak方法的典型用法代码示例。如果您正苦于以下问题:Python Config.tweak方法的具体用法?Python Config.tweak怎么用?Python Config.tweak使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dragonfly.Config
的用法示例。
在下文中一共展示了Config.tweak方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from dragonfly import Config [as 别名]
# 或者: from dragonfly.Config import tweak [as 别名]
- Say **"upper that"** to convert the selected text to upper case.
"""
# import logging
from dragonfly.windows.clipboard import Clipboard
from dragonfly import Config, Section, Item, Grammar, CompoundRule, Key
from supporting import utils
# rule_log = logging.getLogger("rule")
# ---------------------------------------------------------------------------
# Set up this module's configuration.
config = Config("Text Manipulation")
config.tweak = Section("Tweak section")
config.tweak.upper = Item("upper that", doc="Command to convert the selected text to uppercase.")
config.tweak.lower = Item("lower that", doc="Command to convert the selected text to lower case.")
# config.generate_config_file()
config.load()
# ===========================================================================
# Create this module's main grammar object.
grammar = Grammar("text manipulation")
class UpperRule(CompoundRule):
spec = config.tweak.upper
def _process_recognition(self, node, extras):