[IPython-dev] Custom sentinels

Edward K. Ream edreamleo@gmail....
Wed Feb 13 17:08:44 CST 2008


> How can I cause those 2 empty lines to appear between every collected
(tangled?) child node, when I'm using g.getScript()?

It's easily done, with some minor changes to Leo's core.

g.getScript computes the script as follows:

script = at.writeFromString(
    p.copy(),s,
    forcePythonSentinels=forcePythonSentinels,
    useSentinels=useSentinels)

So we'll just add an isIPython keyword argument to both g.getScript and
at.writeFromString.  at.writeFromString (or more likely, one of its helpers)
will then insert the extra lines as needed.

As you can see, at.writeFromString already has several options that were put
there to support scripting.  Adding one more will be harmless.

BTW, all these hacks could be done in a Leo plugin, because plugins can
override any method in Leo's core.  But there is no reason to do that--it's
easier just make the changes directly.

Edward
--------------------------------------------------------------------
Edward K. Ream email: edreamleo@gmail.com
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-dev/attachments/20080213/75452566/attachment.html 


More information about the IPython-dev mailing list