Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-24 Thread Thomas Passin
On Sunday, December 24, 2023 at 5:50:42 AM UTC-5 Edward K. Ream wrote: - Define a shared @command f1 node in your myLeoSetting.leo for your function f1. - Execute the function with: c.doCommandByName("f1"). That's how most of my custom things work. -- You received this message because you

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-24 Thread HaveF HaveF
Here is the easy (and flexible!) way: - Define a shared @command f1 node in your myLeoSetting.leo for your function f1. - Execute the function with: c.doCommandByName("f1"). I'm going to do a bit of a balance between plugins or the way which you said. For now, Thomas's approach to 'place a

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-24 Thread Edward K. Ream
On Sat, Dec 23, 2023 at 8:23 PM HaveF HaveF wrote: > I frequently employ the same specific functions such as fun1, fun2, and so on. Here is the easy (and flexible!) way: - Define a shared @command f1 node in your myLeoSetting.leo for your function f1. - Execute the function with:

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-23 Thread HaveF HaveF
> > One thing you will have to decide is where the plugin should live. You > don't want it to be in the Leo codebase since it's personal. Leo will load > plugins from sys.path if you list them in the @enabled-plugins setting if > you give the module name without the ".py" extension. So you

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-23 Thread Thomas Passin
I don't have a large objection to creating a plugin. One thing you will have to decide is where the plugin should live. You don't want it to be in the Leo codebase since it's personal. Leo will load plugins from sys.path if you list them in the @enabled-plugins setting if you give the

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-23 Thread HaveF HaveF
> > You can put all these function definitions in a node or nodes and install > them by running the node with CTRL-b. Or if there are so many that you > want to put them in a module, you can import them from the module, but it > doesn't have to be a plugin. You could put it into, for example, >

Re: question about code organization issues for personal common libraries and multiple plug-ins

2023-12-23 Thread Thomas Passin
It sounds more complex than necessary to me. I'm not sure what kind of functions you have in mind. But there are several ways to attach functions globally. One way is that g has a user dict, whose name I forget right now. Let's call it g.userdict, though that's probably not its real name.

question about code organization issues for personal common libraries and multiple plug-ins

2023-12-23 Thread HaveF HaveF
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