#1880 merged into devel

46 views
Skip to first unread message

Edward K. Ream

unread,
Apr 22, 2021, 7:01:02 AM4/22/21
to leo-editor
#1880 reports a problem loading plugins and suggests a fix. Here I'll summarize what I did and how to load plugins

What I did

I made the fix suggested in the initial bug report. In some sense this is all that was needed. However, the old code in plugins.regularizeName was extremely confusing. I simplified that code and added comments.

How to load plugins

Most users will enable plugins using @enabled-plugins. This should work exactly as before. The body text of @enabled-plugins can be either:

- A file name, ending in .py, specifying a file in the leo/plugins directory.
- A module name (not ending in .py) specifying a fully qualified module name, such that python can import the module (the name is on the python path).

It is also possible to load plugins using an @plugin node, which must be a child of @settings. The format of can be either:

@plugin x.py
@plugin x.y.z

Again, if a .py extension is given, the file x.py must appear in the leo/plugins directory. If no .py extension is given, then the module x.y.z must be a fully qualified module name on python's path.

Summary

Very little has actually changed. However, importing modules outside of leo/plugins now works.

Edward

Jacob Peck

unread,
Apr 22, 2021, 8:20:29 AM4/22/21
to leo-e...@googlegroups.com
Thanks a ton!
-Jake

On Apr 22, 2021, at 7:01 AM, Edward K. Ream <edre...@gmail.com> wrote:


--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/21fe488a-a664-4dae-9c43-72645f72716en%40googlegroups.com.

Edward K. Ream

unread,
Apr 22, 2021, 8:24:56 AM4/22/21
to leo-editor


On Thu, Apr 22, 2021 at 7:20 AM Jacob Peck <gates...@gmail.com> wrote:
Thanks a ton!

You're welcome. Your code was the only substantial change, but it took me several hours to understand why and to clarify various bizarre pieces of code.

Edward
Reply all
Reply to author
Forward
0 new messages