On Tue, 30 Jul 2013 06:42:29 -0700 (PDT)
Fidel Pérez <[email protected]> wrote:
> *Question of the post:*
> *Is there a way to interact with a closed Leo outline? Such as writing new
> nodes on it, reading the nodes, finding nodes by name or reference, etc?*
Yes, leoBridge.
import leo.core.leoBridge as leoBridge
bridge = leoBridge.controller(gui='nullGui',
loadPlugins=False, # True: attempt to load plugins.
readSettings=False, # True: read standard settings files.
silent=False, # True: don't print signon messages.
verbose=False) # True: print informational messages.
g = bridge.globals()
print dir(bridge)
c = bridge.openLeoFile("/home/tbrown/Package/leo/leoweb/test.leo")
At this point you have c and g, but no interface. All the normal
c.selectPosition(), c.p.insertAsLastChild() etc. works.
Cheers -Terry
> *Reason why I need it:*
> I have been working further in the Leo interaction-tutorial project and Im
> happy to say Im very near being able to actually release something into Leo.
>
> So far, I have a few nodes which are the "information" (A) to the program,
> such as the available Leo commands, directives to generate Gui elements,
> etc, and then the "program itself" (B), which reads and acts upon the
> information nodes, producing a new outline which is the "result" (C)
> outline.
>
> Now, for been able to run any of such "programs" (B), I must have the
> information (A) node available in the same Leo outline where the program
> (B) is, and of course the result outline (C) must also be there.
>
> So the next step in this direction, is to be able to store the trees
> separately, but been able to read and write then even if their outlines are
> closed.
>
> This will basically turn Leo files into small modular outlines filled in
> with information (A), that will be able to interact between each other
> given a director node (B) which contains the instructions for them to
> interact, resulting in (C) structures.
>
> This may sound very weird now but I will soon demonstrate what I mean with
> what I am preparing.
>
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.