I've been reading through the examples in the Scripting Chapter of the
User Guide, and have been trying to learn how to script Leo. I ran
into a couple of problems which might affect other newbies, and which
I think would be worth correcting.
(1) Various of the code examples use print(), where I think they
should use g.es(). For instance the following gives an invalid syntax
error unless you replace print() with g.es():
current = p.copy()
print("inclusive parents of %s" % current.h,color="purple")
for p in current.self_and_parents():
print(p.h)
So should all the print statements in this chapter be changed to g.es
()?
(2) At the top of the chapter it says that you can run all the code
examples with CTRL-B. However, this assumes that the text explanation
in the nodes is marked up with @doc. Otherwise Leo attempts to execute
the explanation text as well as the code example, which will then
frequently give a syntax error. I can see two potential remedies --
either mark up the examples appropriately with @doc and @code, or
remind readers to select the elements of the script they want to
execute before pressing CTRL-B.
These problems are with the latest bzr (rev 2696)
James
--
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.