On Sun, Aug 22, 2010 at 11:19 PM, zpcspm <[email protected]> wrote:

>for p in c.all_positions():
>    if p.headString() == 'sorted':
>        children = list(p.children())
>        headlines = [x.headString() for x in children]
>        print headlines
>        break

You need to copy positions if you save them in a list.  If you don't,
they will move, eventually becoming 'None'.  The following is
expected:

> AttributeError: 'NoneType' object has no attribute 'headString'

So this isn't a trivial script :-)

This works::

    children = [z.copy() for z in p.children()]

Edward

-- 
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.

Reply via email to