Re: ENB: reusable Leo functions and some experimental results (work on issue 1598)

2020-06-03 Thread Edward K. Ream
On Tue, Jun 2, 2020 at 12:24 PM vitalije wrote: > Here is a function that generates tuples from the xml content: > I like what I am seeing so far. Also, I was able to download issue-1598-experiments.leo without problems. Edward -- You received this message because you are subscribed to the G

Re: ENB: reusable Leo functions and some experimental results (work on issue 1598)

2020-06-02 Thread vitalije
> > I have a question - you say that the nodes_from_leo_xml()function will be > used for various paste commands. This way, the xml bits have to be parsed > each time the nodes are processed. I would have expected that xml not be > used for internal communications, but only for external intera

Re: ENB: reusable Leo functions and some experimental results (work on issue 1598)

2020-06-02 Thread Thomas Passin
Vitalije, the code you have been showing is very nice indeed. It's short, understandable, and apparently very performant as well. What a pleasure! I have a question - you say that the nodes_from_leo_xml()function will be used for various paste commands. This way, the xml bits have to be parsed

Re: ENB: reusable Leo functions and some experimental results (work on issue 1598)

2020-06-02 Thread vitalije
Here is a function that generates tuples from the xml content: def nodes_from_leo_xml(contents): ''' Parses contents as xml Leo document and returns a generator of the tuples (parent_gnx, gnx, childIndex, h, b, ua, descendentUas) suitable to be piped to the build_tree

ENB: reusable Leo functions and some experimental results (work on issue 1598)

2020-06-02 Thread vitalije
I hope google will accept the attachment containing scripts. I've started implementing some of the propositions discussed earlier in another thread. First of all I think Leo should have a single function that will build an outline from some iterable. def build_tree(c, it): ''' This func