Re: enhancement: warnings instead of fatal error for duplicate calls to gimp_env_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 3, 2010 at 10:16 PM, Joao S. O. Bueno <gwidion@xxxxxxxxxx> wrote:
> On Tue, Mar 2, 2010 at 2:58 PM, Sven Neumann <sven@xxxxxxxx> wrote:
>> On Tue, 2010-03-02 at 08:01 -0500, lloyd konneker wrote:
>>
>> I wonder if importing a plug-in from another plug-in is really something
>> that we want to support. If the goal is to share code, then perhaps the
>> code that is worth sharing should be factored out into a Python module
>> that the plug-ins can import.
>>
>
> Every Python program is also able to be a python module that plug-ins
> can import. We should preserve this feature of the language.
>
> (For example, one can implement an app with a comand line interface,
> and then just add a GUI in another file that uses the functions
> defined on the stand-alone first file).

I've considered this problem a fair bit, and my opinion is that if you
want this functionality, you should simply guard your register()s. We
cannot safely 'co-opt' python plugins that are not written with this
functionality in mind, as they are designed to be run always in an
independent process (hence they may do initialization which confuses
the calling program, or vice versa); there is no modification to GIMP
which could permit that, it is a logistical problem not a technical
one.

Allowing python plugins to make separate modules available on
installation, similar to Sven's suggestion, seems to me the most
practical suggestion. This means we would add two items to sys.path --
one the site modules* directory, and the other the modules* directory
belonging to the specific user, which the installation of the plugin
package could put modules into.

We could further postulate that the normal python modules directory
should be the destination of modules that do not require GIMP running
in order to function, and only GIMP-requiring modules would be
installed in it's modules* directory.
I make this distinction because there are various good reasons not to
install gimp-dependent modules in the global namespace (for example,
pydoc and the general help() facility get confused because the imports
of gimp modules fail.. so you can look up a specific module, but not
search.)

* I realize 'modules' is a term already used in the gimp directory
structure. This is meant as a placeholder for something
else...python-modules?
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux