RunOnce
dendron.decorators.run_once.RunOnce
Bases: DecoratorNode
The RunOnce decorator tracks whether or not its child has been
ticked. If it has, the next time it is ticked the decorator will
return a status of SKIPPED
. It will continue to return that
status until it is explicitly reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
`str`
|
The given name of this node. |
required |
child |
`dendron.tree_node.TreeNode`
|
The child node. |
required |
Source code in src/dendron/decorators/run_once.py
reset()
Reset the has_run
tracker so that the child node can be
tick()
ed again.
tick()
If the child node has been tick()
ed already, return a status
of SKIPPED
without tick()
ing the child again. Otherwise
tick()
the child node and set has_run
to True
so that the
node will not be tick()
ed again.