Skip to content

Commit fcc6b1e

Browse files
committed
fixes #84, AsynchronousAction and ContextSeeker upgraded
1 parent 3f420b3 commit fcc6b1e

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

caster/bin/data/ccr/confignavigation.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cmd.map = {
1616
"jump back": AsynchronousAction([L(S(["cancel"], context.nav, ["left", "(~[~{~<"]))
1717
], time_in_seconds=0.1, repetitions=50, rdescript="Jump: Back" ),
1818
"fill <target>": R(Key("escape, escape, end"), show=False) +
19-
AsynchronousAction([L(S(["cancel"], Function, context.fill_within_line))
19+
AsynchronousAction([L(S(["cancel"], Function(context.fill_within_line)))
2020
], time_in_seconds=0.2, repetitions=50, rdescript="Fill" ),
2121

2222
# keyboard shortcuts
@@ -84,7 +84,7 @@ cmd.defaults ={
8484
cmd.ncactive=True
8585

8686
cmd.ncmap = {
87-
"<direction> <time_in_seconds>": AsynchronousAction([L(S(["cancel"], Key, "%(direction)s"))], repetitions=1000, blocking=False ),
87+
"<direction> <time_in_seconds>": AsynchronousAction([L(S(["cancel"], Key("%(direction)s")))], repetitions=1000, blocking=False ),
8888
"erase multi clipboard": R(Function(navigation.erase_multi_clipboard), rdescript="Erase Multi Clipboard"),
8989
"find": R(Key("c-f"), rdescript="Find"),
9090
"replace": R(Key("c-h"), rdescript="Replace"),

caster/dev.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ class DevRule(MappingRule):
106106
"html": R(Text("<html>"), rspec="html spoken"),
107107
"divider": R(Text("<div>"), rspec="div"),
108108
"span": R(Text("<span>"), rspec="span"),
109-
"backward seeker [<text>]": ContextSeeker([L(S(["ashes"], Text, "ashes1 [%(text)s] "),
110-
S(["bravery"], Text, "bravery1 [%(text)s] ")),
111-
L(S(["ashes"], Text, "ashes2 [%(text)s] "),
112-
S(["bravery"], Text, "bravery2 [%(text)s] "))
109+
"backward seeker [<text>]": ContextSeeker([L(S(["ashes"], Text("ashes1 [%(text)s] ")),
110+
S(["bravery"], Text("bravery1 [%(text)s] "))),
111+
L(S(["ashes"], Text("ashes2 [%(text)s] ")),
112+
S(["bravery"], Text("bravery2 [%(text)s] ")))
113113
]),
114114
"forward seeker [<text>]": ContextSeeker(forward=
115-
[L(S(["ashes"], Text, "ashes1 [%(text)s] "),
116-
S(["bravery"], Text, "bravery1 [%(text)s] ")),
117-
L(S(["ashes"], Text, "ashes2 [%(text)s] "),
118-
S(["bravery"], Text, "bravery2 [%(text)s] "))
115+
[L(S(["ashes"], Text("ashes1 [%(text)s] ")),
116+
S(["bravery"], Text("bravery1 [%(text)s] "))),
117+
L(S(["ashes"], Text("ashes2 [%(text)s] ")),
118+
S(["bravery"], Text("bravery2 [%(text)s] ")))
119119
]),
120120
"never-ending": AsynchronousAction([L(S(["ashes", "charcoal"], print_time, None),
121121
S(["bravery"], Text, "bravery1"))

caster/lib/dfplus/state/actions2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def attempt_focus():
144144
found_match=executable in w.executable
145145
if found_match:
146146
try:
147-
147+
# this is still broken
148148
win32gui.SetWindowPos(w.handle,win32con.HWND_NOTOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)
149149
win32gui.SetWindowPos(w.handle,win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)
150150
win32gui.SetWindowPos(w.handle,win32con.HWND_NOTOPMOST, 0, 0, 0, 0, win32con.SWP_SHOWWINDOW + win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)

caster/lib/dfplus/state/stackitems.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
@author: dave
55
'''
6-
from dragonfly import Function, Key, Mimic, Paste, Text, Pause
6+
from dragonfly import Function, Key, Mimic, Paste, Text, Pause, ActionBase
77

88
from caster.lib import control, settings
99
from caster.lib.dfplus.hint.hintnode import NodeAction
@@ -70,22 +70,23 @@ def executeCL(self, cl):# the return value is whether to terminate an Asynchrono
7070
action = cl.result.f
7171
if action==None:
7272
return False
73-
level = cl.index
74-
fnparams = cl.result.parameters
75-
if cl.result.use_spoken:
76-
fnparams = self.spoken[level]
77-
if cl.result.use_rspec:
78-
fnparams = self.eaten_rspec[level]
79-
if not action in [Text, Key, Mimic, Function, Paste, NodeAction]:
80-
# it's a function object
73+
elif isinstance(action, ActionBase):
74+
action.execute(cl.dragonfly_data)
75+
return False
76+
else:
77+
# it's a function object, so get the parameters, if any
78+
level = cl.index
79+
fnparams = cl.result.parameters
80+
if cl.result.use_spoken:
81+
fnparams = self.spoken[level]
82+
if cl.result.use_rspec:
83+
fnparams = self.eaten_rspec[level]
8184
if fnparams == None:
8285
return action()
8386
else:
8487
return action(fnparams)
85-
else:
86-
# it's a dragonfly action, and the parameters are the spec
87-
action(fnparams).execute(cl.dragonfly_data)
88-
return False
88+
89+
8990
def eat(self, level, stack_item):
9091
self.spoken[level] = stack_item.preserved
9192
self.eaten_rspec[level] = stack_item.rspec

caster/lib/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
BASE_PATH = os.path.realpath(__file__).split("\\lib")[0].replace("\\", "/")
99

1010
# title
11-
SOFTWARE_VERSION_NUMBER = "0.4.16"
11+
SOFTWARE_VERSION_NUMBER = "0.5.0"
1212
SOFTWARE_NAME = "Caster v " + SOFTWARE_VERSION_NUMBER
1313
S_LIST_VERSION = "Sticky List v " + SOFTWARE_VERSION_NUMBER
1414
DISPEL_VERSION = "Dispel v " + SOFTWARE_VERSION_NUMBER

0 commit comments

Comments
 (0)