On Tue, Dec 14, 2010 at 7:21 AM, Satheesh Babu Vattekkat
<[email protected]> wrote:
> One really good use I can
> think of is to automate generating outline files from different data
> sources.

> ie., take a minimal file, load it into Leo, then run through my
> exported data and attach instances of leoNodes to the file and then
> save it. I will also need to attach cloned nodes at various points in
> the outline.
>
> Has anyone done this or any pointers on how to go about this?

Creating a new Leo outline will create a minimal .leo file when you
save the outline.

A script can do this with c2 = c.new()

If you don't want to see the new window, you can use the contents of
c.new to guide you. c.new calls::

  c,frame = g.app.newLeoCommanderAndFrame(
        fileName=yourFileName,gui=None)

If gui is None, g.app.gui is used as default.  We may want a null gui::

import leo.core.leoGui as leoGui
nullGui = leoGui.nullGui("nullGui")
c2,frame = g.app.newLeoCommanderAndFrame(
        fileName=None,gui=nullGui)
c2.frame.createFirstTreeNode()
for p in c2.all_positions():
    g.es(p.h)

This works.

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