Useful!
For fun (and perhaps of some use), here is a brute compare of trees. I use
meld, which has a great interface.
I think I will set up a pyflakes button as well; I haven't seen it as part
of Leo, though the Leo error python messages are good.
-----------------------
def add_text(nd):
"""recursively add to text"""
text = "\n\n>> " + nd.h
text += "\n\n%s" % nd.b
for child in nd.children():
text += add_text(child)
return text
selected = c.getSelectedPositions()
open('/tmp/a_diff', 'w').write(add_text(selected[0]).encode("utf-8"))
open('/tmp/b_diff', 'w').write(add_text(selected[1]).encode("utf-8"))
import os
os.system("meld /tmp/a_diff /tmp/b_diff &")
-------------
Le vendredi 1 février 2013 11:08:30 UTC-8, Terry a écrit :
>
> Because I have two nodes which were originally identical but are now
> different and I want to see the differences.
>
> My outline loads a @file called ~/.leo/t/gen which contains a @button
> with several @rclick children for commonly used tasks. So I add a new
> one, @rclick diff
>
> selected = c.getSelectedPositions()
> open('/tmp/a_diff', 'w').write(selected[0].b)
> open('/tmp/b_diff', 'w').write(selected[1].b)
> import os
> os.system("xxdiff /tmp/a_diff /tmp/b_diff &")
>
> which is horrible for a number of reasons but also took only moments
> to write. And now, not only does this Leo session have a visual node
> diff capability, but also every future session which loads ~/.leo/t/gen.
>
> When you can go from wanting to having a feature in less time than it
> takes to write an email about it - well, that's "why Leo".
>
> (I also have @file ~/.leo/sql and @file ~/.leo/dml for commands for
> handling SQL and an XML dialect I use a lot, it's a great way to manage
> little snippet functions)
>
> Cheers -Terry
>
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.