本文整理汇总了Python中dragonfly.Config.cmd方法的典型用法代码示例。如果您正苦于以下问题:Python Config.cmd方法的具体用法?Python Config.cmd怎么用?Python Config.cmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dragonfly.Config
的用法示例。
在下文中一共展示了Config.cmd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from dragonfly import Config [as 别名]
# 或者: from dragonfly.Config import cmd [as 别名]
from dragonfly import Config, Section, Item, MappingRule, Grammar, Text, Key, Function, Dictation
import lib.format
config = Config("capistrano")
config.cmd = Section("helpers")
config.cmd.map = Item(
{
"cap deploy [with] migrations to <text>": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations"),
"cap deploy [with] migrations to <text> with filter": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations FILTER="),
"cap deploy [with] migrations to <text> with filter roles": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations FILTER_ROLES="),
"cap deploy [with] migrations to <text> with assets": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations"),
"cap deploy [with] migrations to <text> with assets with filter": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations FILTER="),
"cap deploy [with] migrations to <text> with assets with filter roles": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy:migrations FILTER_ROLES="),
"cap deploy to <text>": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy"),
"cap deploy to <text> with filter": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy FILTER="),
"cap deploy to <text> with filter roles": Text("SKIP_ASSETS=true RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy FILTER_ROLES="),
"cap deploy to <text> with assets": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy"),
"cap deploy to <text> with assets with filter": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy FILTER="),
"cap deploy to <text> with assets with filter roles": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap deploy FILTER_ROLES="),
"cap invoke to <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap invoke COMMAND=\"\"") + Key("left:1"),
"cap invoke to <text> with filter": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap invoke COMMAND=\"\" FILTER="),
"cap invoke to <text> with filter roles": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap invoke COMMAND=\"\" FILTER_ROLES="),
"cap rubber reboot <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap rubber:reboot ALIAS=") + Function(lib.format.lowercase_text),
"cap rubber bootstrap <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap rubber:bootstrap FILTER=") + Function(lib.format.lowercase_text),
"cap rubber set up security groups <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap rubber:setup_security_groups FILTER=") + Function(lib.format.lowercase_text),
"cap rubber set up local aliases <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap rubber:setup_local_aliases"),
"cap rubber set up remote aliases <text>": Text("RUBBER_ENV=") + Function(lib.format.lowercase_text) + Text(" cap rubber:setup_remote_aliases"),
示例2: Key
# 需要导入模块: from dragonfly import Config [as 别名]
# 或者: from dragonfly.Config import cmd [as 别名]
release.execute()
Key("c-c/3").execute()
def paste_command():
# Add Command Prompt, putty, ...?
context = AppContext(executable="console")
window = Window.get_foreground()
if context.matches(window.executable, window.title, window.handle):
return
release.execute()
Key("c-v/3").execute()
grammarCfg = Config("multi edit")
grammarCfg.cmd = Section("Language section")
grammarCfg.cmd.map = Item(
{
# Navigation keys.
"up [<n>]": Key("up:%(n)d"),
"up [<n>] slow": Key("up/15:%(n)d"),
"down [<n>]": Key("down:%(n)d"),
"down [<n>] slow": Key("down/15:%(n)d"),
"left [<n>]": Key("left:%(n)d"),
"left [<n>] slow": Key("left/15:%(n)d"),
"right [<n>]": Key("right:%(n)d"),
"right [<n>] slow": Key("right/15:%(n)d"),
"page up [<n>]": Key("pgup:%(n)d"),
"page down [<n>]": Key("pgdown:%(n)d"),
"up <n> (page|pages)": Key("pgup:%(n)d"),
"down <n> (page|pages)": Key("pgdown:%(n)d"),