On Wed, Nov 16, 2011 at 12:11 PM, Edward K. Ream <[email protected]> wrote:
> The clarity makes everything simple. I see now that a query object is
> simply a new-lint Context object.
Rev 4813 contains the first successful demo of leoInspect!
Here is the Leo script::
import leo.core.leoInspect as inspect
dump_modules = False
m = inspect.module(c,'leoEditCommands.py',print_stats=True,print_times=True)
for o in m.classes:
if dump_modules:
o.dump(verbose=False)
else:
print(o)
for f in o.functions:
print(' %s' % f)
And here is the output::
QQQQQ
Dump of statistics...
errors: 0
contexts: 732
modules: 1
assignments: 2476
calls: 3241
classes: 22
defs: 602
fors: 85
globals: 5
imports: 18
lambdas: 2
list_comps: 20
withs: 0
attributes: 4493
ivars: 0
names: 5012
del_names: 0
load_names: 5747
param_names: 2
store_names: 2512
parse_time: 0.13
pass1_time: 0.26
total_time: 0.39
class(baseEditCommandsClass)
def(__init__)
def(finishCreate)
def(init)
def(beginCommand)
def(beginCommandWithEvent)
def(beginCommandHelper)
def(endCommand)
def(editWidget)
def(getPublicCommands)
def(getWSString)
def(oops)
def(_chckSel)
def(_checkIfRectangle)
def(getRectanglePoints)
def(keyboardQuit)
class(abbrevCommandsClass)
def(__init__)
def(finishCreate)
def(getPublicCommands)
def(expandAbbrev)
def(dynamicCompletion)
def(dynamicExpansion)
def(dynamicExpandHelper)
def(getDynamicList)
def(addAbbrevHelper)
def(addAbbreviation)
def(addInverseAbbreviation)
def(killAllAbbrevs)
def(listAbbrevs)
def(readAbbreviations)
def(readAbbreviationsFromFile)
def(toggleAbbrevMode)
def(writeAbbreviations)
[big snip]
.
----------------------------------------------------------------------
Ran 1 test in 0.642s
OK
leoDynamicUnittest.py: 1.55sec
QQQQQ
Important: the "class" and "def" entries are not just strings. They
are representations of real Context classes, which means that they
already support, or soon will support, the getters I have been talking
about.
In short, we are *very* close to having a fully functional leoInspect module.
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.