本文整理汇总了Python中dragonfly.Config.load方法的典型用法代码示例。如果您正苦于以下问题:Python Config.load方法的具体用法?Python Config.load怎么用?Python Config.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dragonfly.Config
的用法示例。
在下文中一共展示了Config.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from dragonfly import Config [as 别名]
# 或者: from dragonfly.Config import load [as 别名]
#---------------------------------------------------------------------------
# Set up this module's configuration.
config = Config("config manager")
config.lang = Section("Language section")
config.lang.list_configs = Item("list configs",
doc="Command to ...")
config.lang.edit_config = Item("edit <config> (config | configuration)",
doc="Command to ...")
config.lang.show_dragonfly_version = Item("show dragonfly version",
doc="Command to ...")
config.lang.update_dragonfly = Item("update dragonfly version",
doc="Command to ...")
config.lang.reload_natlink = Item("reload natlink",
doc="Command to ...")
config.load()
#---------------------------------------------------------------------------
config_map = DictList("config_map")
#---------------------------------------------------------------------------
class ConfigManagerGrammar(Grammar):
def __init__(self):
Grammar.__init__(self, name="config manager", context=None)
def _process_begin(self, executable, title, handle):
示例2: Config
# 需要导入模块: from dragonfly import Config [as 别名]
# 或者: from dragonfly.Config import load [as 别名]
Key,
Text,
)
from aenea.proxy_contexts import ProxyAppContext as NixAppContext
hipchat_config = Config("HipChat")
hipchat_config.usernames = Section("Username Mappings")
hipchat_config.usernames.map = Item(
{
"All": "all",
"Here": "here"
}
)
hipchat_config.load()
class NavigationRule(MappingRule):
mapping = {
"move up [<n>]": Key("cs-tab:%(n)d"),
"move down [<n>]": Key("c-tab:%(n)d"),
"close tab": Key("c-w"),
"(join room | private message) <room>": Key("c-j/25") + Text("%(room)s") + Key("enter"),
"search [room] history": Key("c-f"),
}
extras = [
IntegerRef("n", 1, 10),
Dictation("room"),
]