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