[Gambas-user] can i specify a path to my modules or libs please how?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Tue Apr 17 21:02:58 CEST 2018


umm interesting way Tobias .. i get that mail and read it too!

umm in conclusion "it cannot be", but now i ask something about gambas
library/modules

if i have in my project only module sources and in last step i poin that
use library, this mix can be done?

i mean, that the  final product due the sources are "linked" or not real in
the project will use the library?




Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2018-04-17 12:24 GMT-04:00 Tobias Boege <taboege at gmail.com>:

> On Tue, 17 Apr 2018, PICCORO McKAY Lenz wrote:
> > i want to made my ow daemon and need to load/use others dinamically made
> > modules/programs inside that deamon
> >
> > how can i set that from the code? the library path or module?
> >
>
> I don't know if there is a good way to do this now, but I'll tell you
> how I did this three years ago. It's not for the faint of heart, but
> up to the occasional svn/git merge conflict, it has been working here.
>
> About the scope: In some projects, I wanted to allow plugins written
> in Gambas, which the user can store in standalone text files or .tar.gz
> source archives somewhere under $HOME/.config. These can be loaded
> dynamically and interact with the main program through a monolithic
> Context object which is passed to the plugin constructor.
>
> First you need to enable loading of components by absolute paths.
> I attach a patch which should apply to git master, then you have to
> recompile Gambas. IIRC Benoit considers this a security risk, so
> it's not in the official Gambas source tree.
>
> Next, look at the Plugins.module in the attached sample project.
> This is where the fun starts. You can pass a text file or project
> source archive to Plugins.Add(). In both cases, the Plugins module
> copies the source code into a temporary location, vamps it up into
> a component project and builds that (you need to have gbc3 and gba3
> installed). Thanks to the patched interpreter, this component can
> be loaded via Component.Load() now. The standalone class file or
> the startup class of the .tar.gz project is instantiated with the
> Context object, and that's it.
>
> If you can get the attached project to run, you will see the spinning
> triangle in the DrawingArea from the main program as well as the current
> time being displayed in the top-left corner via the plugin.
>
> That said, I wouldn't recommend this way, obviously. I just wanted to
> show that it can be done in a way that's adequate if you make a hobby
> project, like I did in 2015. (And that code hasn't been touched since.)
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180417/5b10d8a2/attachment.html>


More information about the User mailing list