On Wed, Nov 16, 2011 at 9:20 AM, Edward K. Ream <[email protected]> wrote:
> Assignments are especially important. Two more getters deliver the
> right-hand-side and left-hand-side of an assignment a::
>
> o = lhs(a)
> o = rhs(a)
Instead of this, or in addition, there will be the following getters::
aList = assignments_to(arg)
aList = assignments_using(arg)
Here arg can be either a query object or name (string).
With this in place, the script to discover all assignments to 'w' in
leoEditCommands.py is::
import leo.core.leoInspect as inspect
m = inspect.module('leoEditCommands')
for z in m.assignments_to('w'):
print(inspect.format(z))
This is simple enough to be exciting! Some notes:
1. Yes, it really will be possible to use just 'leoEditCommands' as
the argument to module. leoInspect will know about Leo's files.
2. By default, format will delete leading whitespace, line numbers,
file names, etc, but there will be keyword options to enable all that
and more.
3. The script prints all assignments to 'w' anywhere in
leoEditCommands.py. But it would be trivial to "zero in" on
particular classes or methods with one or two more lines of code.
This is way too good to ignore. I expect to have something working in
an hour or three...
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.