Skip to content

Commit

Permalink
fixes #101, NodeRule reset bug
Browse files Browse the repository at this point in the history
  • Loading branch information
synkarius committed Sep 5, 2015
1 parent 7547853 commit bf6677e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions caster/lib/dfplus/hint/hintnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
'''
from dragonfly import MappingRule, ActionBase


from caster.lib.dfplus.state.actions import ContextSeeker
from caster.lib.dfplus.state.short import L, S


class HintNode:
def __init__(self, spec, base, children=[], extras=[], defaults={}):
err = str(spec)+", "+str(base)+", "+str(children)
Expand Down Expand Up @@ -71,7 +73,9 @@ def __init__(self, node, grammar, stat_msg=None, is_reset=False):
if self.master_node == None:
self.master_node = self.node
first = True
self.post = ContextSeeker(forward=[L(S(["cancel"], self.reset_node, consume=False))], rspec=self.master_node.spec)
self.post = ContextSeeker(forward=[L(S(["cancel"], self.reset_node, consume=False),
S([self.master_node.spec], lambda: None, consume=False))],
rspec=self.master_node.spec)
if self.stat_msg == None:
self.stat_msg = stat_msg

Expand All @@ -82,7 +86,6 @@ def __init__(self, node, grammar, stat_msg=None, is_reset=False):
# each child node gets turned into a mapping key/value
for child in self.node.children:
child.fill_out_rule(mapping, extras, defaults, self)

if len(mapping)==0:
if self.stat_msg!=None and not first:
self.stat_msg.text("Node Reset")# status window messaging
Expand Down

0 comments on commit bf6677e

Please sign in to comment.