Hi, Leo Lovers,
Upon your suggestions to learn more about Leo, I examined the LeoPyRef
file, and learned the g.pdb() method for an in-depth exploration, which was
great. I like it!
I now have an idea and seek your input. I realized that in various Leo
files, I frequently employ same specific functions such as fun1, fun2, and
so on.
Investigating further, I discovered a plugin that could help me with that.
The steps are as follows:
1. Develop a plugin named personal_common_functions and incorporate these
functions into it.
2. Once the plugin is developed, activate it.
3. Create script within a Leo node, similar to the example below:
```
fun1 = g.getPluginModule('leo.plugins.personal_common_functions').fun1
fun2 = g.getPluginModule('leo.plugins.personal_common_functions').fun2
...
... utilize fun1 and fun2 ...
...
```
Execute the script by pressing Ctrl-B. This addresses the initial issue.
However, a new challenge arises: if I have multiple plugins, such as
plugin1 and plugin2, and they both rely on the personal_common_functions
plugin, is it possible to activate the personal_common_functions plugin and
call fun1 within plugin1 and plugin2 using
g.getPluginModule('leo.plugins.personal_common_functions').fun1?
is this the best practice for code organization?
Thanks!
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/78fd33b5-f40c-45c5-b23f-6acd0bf44049n%40googlegroups.com.