Skip to content

Commit

Permalink
yapf formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrob95 committed Sep 20, 2018
1 parent d70de9d commit f5f26bd
Showing 1 changed file with 64 additions and 41 deletions.
105 changes: 64 additions & 41 deletions caster/lib/ccr/core/nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class NavigationNon(MappingRule):
"garb [<nnavi500>]":
R(Mouse("left") + Mouse("left") + Function(
navigation.stoosh_keep_clipboard, nexus=_NEXUS),
rdescript="Highlight @ Mouse + Copy"),
rdescript="Highlight @ Mouse + Copy"),
"drop [<nnavi500>]":
R(Mouse("left") + Mouse("left") + Function(
navigation.drop_keep_clipboard, nexus=_NEXUS),
rdescript="Highlight @ Mouse + Paste"),
rdescript="Highlight @ Mouse + Paste"),
"sure stoosh":
R(Key("c-c"), rdescript="Simple Copy"),
"sure cut":
Expand Down Expand Up @@ -160,55 +160,78 @@ class Navigation(MergeRule):

mapping = {
# "periodic" repeats whatever comes next at 1-second intervals until "cancel" is spoken or 100 tries occur
"periodic": ContextSeeker(forward=[L(S(["cancel"], lambda: None), \
S(["*"], \
lambda fnparams: UntilCancelled(Mimic(*filter(lambda s: s != "periodic", fnparams)), 1).execute(), \
use_spoken=True))]),
"periodic":
ContextSeeker(forward=[L(S(["cancel"], lambda: None),
S(["*"], lambda fnparams: UntilCancelled(Mimic(*filter(lambda s: s != "periodic", fnparams)), 1).execute(),
use_spoken=True))]),
# VoiceCoder-inspired -- these should be done at the IDE level
"fill <target>": R(Key("escape, escape, end"), show=False) +
AsynchronousAction([L(S(["cancel"], Function(context.fill_within_line, nexus=_NEXUS)))
], time_in_seconds=0.2, repetitions=50, rdescript="Fill" ),
"jump in": AsynchronousAction([L(S(["cancel"], context.nav, ["right", "(~[~{~<"]))
], time_in_seconds=0.1, repetitions=50, rdescript="Jump: In" ),
"jump out": AsynchronousAction([L(S(["cancel"], context.nav, ["right", ")~]~}~>"]))
], time_in_seconds=0.1, repetitions=50, rdescript="Jump: Out" ),
"jump back": AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))
], time_in_seconds=0.1, repetitions=50, rdescript="Jump: Back" ),
"jump back in": AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))
], finisher=Key("right"),
time_in_seconds=0.1,
repetitions=50,
rdescript="Jump: Back In" ),
"fill <target>":
R(Key("escape, escape, end"), show=False) +
AsynchronousAction([L(S(["cancel"], Function(context.fill_within_line, nexus=_NEXUS)))],
time_in_seconds=0.2, repetitions=50, rdescript="Fill" ),
"jump in":
AsynchronousAction([L(S(["cancel"], context.nav, ["right", "(~[~{~<"]))],
time_in_seconds=0.1, repetitions=50, rdescript="Jump: In"),
"jump out":
AsynchronousAction([L(S(["cancel"], context.nav, ["right", ")~]~}~>"]))],
time_in_seconds=0.1, repetitions=50, rdescript="Jump: Out"),
"jump back":
AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))],
time_in_seconds=0.1, repetitions=50, rdescript="Jump: Back"),
"jump back in":
AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))],
finisher=Key("right"), time_in_seconds=0.1, repetitions=50, rdescript="Jump: Back In" ),

# keyboard shortcuts
'save': R(Key("c-s"), rspec="save", rdescript="Save"),
'shock [<nnavi50>]': R(Key("enter"), rspec="shock", rdescript="Enter")* Repeat(extra="nnavi50"),
'save':
R(Key("c-s"), rspec="save", rdescript="Save"),
'shock [<nnavi50>]':
R(Key("enter"), rspec="shock", rdescript="Enter")* Repeat(extra="nnavi50"),

"(<mtn_dir> | <mtn_mode> [<mtn_dir>]) [(<nnavi500> | <extreme>)]": R(Function(textformat.master_text_nav), rdescript="Keyboard Text Navigation"),
"(<mtn_dir> | <mtn_mode> [<mtn_dir>]) [(<nnavi500> | <extreme>)]":
R(Function(textformat.master_text_nav), rdescript="Keyboard Text Navigation"),

"stoosh [<nnavi500>]": R(Function(navigation.stoosh_keep_clipboard, nexus=_NEXUS), rspec="stoosh", rdescript="Copy"),
"cut [<nnavi500>]": R(Function(navigation.cut_keep_clipboard, nexus=_NEXUS), rspec="cut", rdescript="Cut"),
"spark [<nnavi500>]": R(Function(navigation.drop_keep_clipboard, nexus=_NEXUS), rspec="spark", rdescript="Paste"),
"stoosh [<nnavi500>]":
R(Function(navigation.stoosh_keep_clipboard, nexus=_NEXUS), rspec="stoosh", rdescript="Copy"),
"cut [<nnavi500>]":
R(Function(navigation.cut_keep_clipboard, nexus=_NEXUS), rspec="cut", rdescript="Cut"),
"spark [<nnavi500>]":
R(Function(navigation.drop_keep_clipboard, nexus=_NEXUS), rspec="spark", rdescript="Paste"),

"deli [<nnavi50>]": R(Key("del/5"), rspec="deli", rdescript="Delete") * Repeat(extra="nnavi50"),
"clear [<nnavi50>]": R(Key("backspace/5:%(nnavi50)d"), rspec="clear", rdescript="Backspace"),
SymbolSpecs.CANCEL: R(Key("escape"), rspec="cancel", rdescript="Cancel Action"),
"deli [<nnavi50>]":
R(Key("del/5"), rspec="deli", rdescript="Delete") * Repeat(extra="nnavi50"),
"clear [<nnavi50>]":
R(Key("backspace/5:%(nnavi50)d"), rspec="clear", rdescript="Backspace"),
SymbolSpecs.CANCEL:
R(Key("escape"), rspec="cancel", rdescript="Cancel Action"),


"shackle": R(Key("home/5, s-end"), rspec="shackle", rdescript="Select Line"),
"(tell | tau) <semi>": R(Function(navigation.next_line), rspec="tell dock", rdescript="Complete Line"),
"duple [<nnavi50>]": R(Function(navigation.duple_keep_clipboard), rspec="duple", rdescript="Duplicate Line"),
"Kraken": R(Key("c-space"), rspec="Kraken", rdescript="Control Space"),
"shackle":
R(Key("home/5, s-end"), rspec="shackle", rdescript="Select Line"),
"(tell | tau) <semi>":
R(Function(navigation.next_line), rspec="tell dock", rdescript="Complete Line"),
"duple [<nnavi50>]":
R(Function(navigation.duple_keep_clipboard), rspec="duple", rdescript="Duplicate Line"),
"Kraken":
R(Key("c-space"), rspec="Kraken", rdescript="Control Space"),

# text formatting
"set format (<capitalization> <spacing> | <capitalization> | <spacing>) (bow|bowel)": R(Function(textformat.set_text_format), rdescript="Set Text Format"),
"clear caster formatting": R(Function(textformat.clear_text_format), rdescript="Clear Caster Formatting"),
"peek format": R(Function(textformat.peek_text_format), rdescript="Peek Format"),
"(<capitalization> <spacing> | <capitalization> | <spacing>) (bow|bowel) <textnv> [brunt]": R(Function(textformat.master_format_text), rdescript="Text Format"),
"format <textnv>": R(Function(textformat.prior_text_format), rdescript="Last Text Format"),
"<word_limit> format <textnv>": R(Function(textformat.partial_format_text), rdescript="Partial Text Format"),
"hug <enclosure>": R(Function(textformat.enclose_selected), rdescript="Enclose text "),
"dredge": R(Key("a-tab"), rdescript="Alt-Tab"),
"set format (<capitalization> <spacing> | <capitalization> | <spacing>) (bow|bowel)":
R(Function(textformat.set_text_format), rdescript="Set Text Format"),
"clear caster formatting":
R(Function(textformat.clear_text_format), rdescript="Clear Caster Formatting"),
"peek format":
R(Function(textformat.peek_text_format), rdescript="Peek Format"),
"(<capitalization> <spacing> | <capitalization> | <spacing>) (bow|bowel) <textnv> [brunt]":
R(Function(textformat.master_format_text), rdescript="Text Format"),
"format <textnv>":
R(Function(textformat.prior_text_format), rdescript="Last Text Format"),
"<word_limit> format <textnv>":
R(Function(textformat.partial_format_text), rdescript="Partial Text Format"),
"hug <enclosure>":
R(Function(textformat.enclose_selected), rdescript="Enclose text "),
"dredge":
R(Key("a-tab"), rdescript="Alt-Tab"),

}

Expand Down

0 comments on commit f5f26bd

Please sign in to comment.