2013/6/18 Laurent Bristiel <
lau...@bristiel.com>:
Looks nice!
> Only thing I did not find out was how to "visit" the keywords recursively.
> My code just visit the first level keywords, whereas I would have like to be
> able to visit all the levels (or choose a depth).
This happens because your visitor overwrites visit_keyword method that
takes care of the recursion. The easiest solution is to override
start_keyword (or end_keyword) instead, and let visit_keyword's
default implementation handle recursion for you. Notice that if you,
for any reason, want to stop the recursion, your start_keyword just
need to return explicit False.
It's a shame the visitor interface is not documented better. It is
really powerful and easy to use when you know what you are doing.
Could you submit an issue about enhancing docs related to it? I'm sure
we find time to take care of that at some point. Until that, it's
probably easiest to look at the source to see how base visitors are
implemented and how they are used internally in the framework.