On Sat, Feb 6, 2010 at 12:11 AM, Terry Brown <[email protected]> wrote:
> This post thinks about making a cursor / navigator object for Leo outlines to > pass into code that wants to treat a Leo doc. as structured data at a higher > level than fiddling with positions etc. directly. Somewhat analogous are the "poslists", returned e.g. by find_h - list of positions you can "refine" by tree traversal. OTOH, they are more "functional programming" like (comparable to jQuery selectors and XPath), while you seem to suggest a stafeful cursor that moves as commands are executed. I sort of like the idea, it naturally maps to how people traverse filesystem with "cd". A fun experiment could be implementing the __div__ in position class, like: p2 = p / "Teacher" You may want to try monkeypatching that to position class in a plugin, and see how it works out :-). IPython "workbook" concept implemented finding a node globally through getattr, and accessing children with dict notation: foo['child string']. For your templating purposes using getattr for that may be better. -- Ville M. Vainio http://tinyurl.com/vainio -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
