本文整理匯總了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"),
]