Skip to content

Commit

Permalink
fixes #84, AsynchronousAction and ContextSeeker upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
synkarius committed Aug 2, 2015
1 parent 3f420b3 commit fcc6b1e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions caster/bin/data/ccr/confignavigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cmd.map = {
"jump back": AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))
], time_in_seconds=0.1, repetitions=50, rdescript="Jump: Back" ),
"fill <target>": R(Key("escape, escape, end"), show=False) +
AsynchronousAction([L(S(["cancel"], Function, context.fill_within_line))
AsynchronousAction([L(S(["cancel"], Function(context.fill_within_line)))
], time_in_seconds=0.2, repetitions=50, rdescript="Fill" ),

# keyboard shortcuts
Expand Down Expand Up @@ -84,7 +84,7 @@ cmd.defaults ={
cmd.ncactive=True

cmd.ncmap = {
"<direction> <time_in_seconds>": AsynchronousAction([L(S(["cancel"], Key, "%(direction)s"))], repetitions=1000, blocking=False ),
"<direction> <time_in_seconds>": AsynchronousAction([L(S(["cancel"], Key("%(direction)s")))], repetitions=1000, blocking=False ),
"erase multi clipboard": R(Function(navigation.erase_multi_clipboard), rdescript="Erase Multi Clipboard"),
"find": R(Key("c-f"), rdescript="Find"),
"replace": R(Key("c-h"), rdescript="Replace"),
Expand Down
16 changes: 8 additions & 8 deletions caster/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ class DevRule(MappingRule):
"html": R(Text("<html>"), rspec="html spoken"),
"divider": R(Text("<div>"), rspec="div"),
"span": R(Text("<span>"), rspec="span"),
"backward seeker [<text>]": ContextSeeker([L(S(["ashes"], Text, "ashes1 [%(text)s] "),
S(["bravery"], Text, "bravery1 [%(text)s] ")),
L(S(["ashes"], Text, "ashes2 [%(text)s] "),
S(["bravery"], Text, "bravery2 [%(text)s] "))
"backward seeker [<text>]": ContextSeeker([L(S(["ashes"], Text("ashes1 [%(text)s] ")),
S(["bravery"], Text("bravery1 [%(text)s] "))),
L(S(["ashes"], Text("ashes2 [%(text)s] ")),
S(["bravery"], Text("bravery2 [%(text)s] ")))
]),
"forward seeker [<text>]": ContextSeeker(forward=
[L(S(["ashes"], Text, "ashes1 [%(text)s] "),
S(["bravery"], Text, "bravery1 [%(text)s] ")),
L(S(["ashes"], Text, "ashes2 [%(text)s] "),
S(["bravery"], Text, "bravery2 [%(text)s] "))
[L(S(["ashes"], Text("ashes1 [%(text)s] ")),
S(["bravery"], Text("bravery1 [%(text)s] "))),
L(S(["ashes"], Text("ashes2 [%(text)s] ")),
S(["bravery"], Text("bravery2 [%(text)s] ")))
]),
"never-ending": AsynchronousAction([L(S(["ashes", "charcoal"], print_time, None),
S(["bravery"], Text, "bravery1"))
Expand Down
2 changes: 1 addition & 1 deletion caster/lib/dfplus/state/actions2.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def attempt_focus():
found_match=executable in w.executable
if found_match:
try:

# this is still broken
win32gui.SetWindowPos(w.handle,win32con.HWND_NOTOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)
win32gui.SetWindowPos(w.handle,win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)
win32gui.SetWindowPos(w.handle,win32con.HWND_NOTOPMOST, 0, 0, 0, 0, win32con.SWP_SHOWWINDOW + win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)
Expand Down
27 changes: 14 additions & 13 deletions caster/lib/dfplus/state/stackitems.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@author: dave
'''
from dragonfly import Function, Key, Mimic, Paste, Text, Pause
from dragonfly import Function, Key, Mimic, Paste, Text, Pause, ActionBase

from caster.lib import control, settings
from caster.lib.dfplus.hint.hintnode import NodeAction
Expand Down Expand Up @@ -70,22 +70,23 @@ def executeCL(self, cl):# the return value is whether to terminate an Asynchrono
action = cl.result.f
if action==None:
return False
level = cl.index
fnparams = cl.result.parameters
if cl.result.use_spoken:
fnparams = self.spoken[level]
if cl.result.use_rspec:
fnparams = self.eaten_rspec[level]
if not action in [Text, Key, Mimic, Function, Paste, NodeAction]:
# it's a function object
elif isinstance(action, ActionBase):
action.execute(cl.dragonfly_data)
return False
else:
# it's a function object, so get the parameters, if any
level = cl.index
fnparams = cl.result.parameters
if cl.result.use_spoken:
fnparams = self.spoken[level]
if cl.result.use_rspec:
fnparams = self.eaten_rspec[level]
if fnparams == None:
return action()
else:
return action(fnparams)
else:
# it's a dragonfly action, and the parameters are the spec
action(fnparams).execute(cl.dragonfly_data)
return False


def eat(self, level, stack_item):
self.spoken[level] = stack_item.preserved
self.eaten_rspec[level] = stack_item.rspec
Expand Down
2 changes: 1 addition & 1 deletion caster/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
BASE_PATH = os.path.realpath(__file__).split("\\lib")[0].replace("\\", "/")

# title
SOFTWARE_VERSION_NUMBER = "0.4.16"
SOFTWARE_VERSION_NUMBER = "0.5.0"
SOFTWARE_NAME = "Caster v " + SOFTWARE_VERSION_NUMBER
S_LIST_VERSION = "Sticky List v " + SOFTWARE_VERSION_NUMBER
DISPEL_VERSION = "Dispel v " + SOFTWARE_VERSION_NUMBER
Expand Down

0 comments on commit fcc6b1e

Please sign in to comment.