I'm writing a python script which needs to locate Leo's library location in
the filesystem. By looking various places I see the pattern of `import leo.
core.leoGlobals as g` and `g.computeLeoDir()`, but that doesn't work for
me. I get an error of "object has no attribute loadManager". I've dug
through leoPyRef.leo and g.computeLeoDir() redirects to g.app.loadDir()
which in turn is built ...somewhere in leoApp.py? Anyway, I can't find it.
With the following saved as "find-leo-lib.py" and run with "python
find-leo-lib.py":
# Report Leo's library folder
import leo.core.leoGlobals as g
g.es_print(g.computeLeoDir())
Traceback (most recent call last):
File "leo\scripts\find-leo-exe.py", line 14, in <module>
g.es_print(g.computeLeoDir())
File "c:\users\mattw\code\leo-editor\leo\core\leoGlobals.py", line 3409,
in computeLeoDir
return g.app.loadManager.computeLeoDir()
AttributeError: 'NoneType' object has no attribute 'loadManager'
However I have learned that ththe simple block below gets me that answer I
need, for my immediate problem. My question is, since this is so simple but
not used anywhere that I've seen so far, maybe it's not advised for some
reason? (and I should continue trying to spelunk through the depths of
LeoApp.py)
import leo
leolibpath = leo.__path__
print(leolibpath)
Matt
--
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.