Minimal Python plugin

This is a minimal python plugin for GIMP. In contrary to gimpfu-based ones, these do have the functions also available in C plugins (query, init, run, quit) and can (actually, have to) use GTK+ directly to create a user interface.

minimal-really.py

I've attached an minimal-really.py plugin, which does only define what is needed for a plugin (query, and the functions to be used). 99% of all python plug-ins will most likely follow this structure.

 

minimal-real.py

The more complete minimal-real.py defines all things that you might want to redefine in your plugin.

  • init() is run whenever GIMP starts, so if you got something that should be done at this time (e.g. checking if some peripheral is available), do it then
  • quit() is called wheever one of the other functions is finished. so it is not the place to put stuff that should only be executed when GIMP quits, but maybe you can think of some other uses

 

More...?

Yes, you could do even more and redefine start(), which would enable you to change what is actually regarded as init, query, quit and run). And you could have your own run() as well. It's just that right now, I can't imagine why anyone would want to do this. But maybe there are some clever ideas?

AttachmentSize
minimal-real.py814 bytes
minimal-really.py706 bytes
0
Average: 3 (4 votes)

Comments

Hi

Hi,
Thanks a lot for the plugin inPython. I have been searching for this in my whole week.
Thanks again.

Regards,
things to do in sydney

Hey Thanks!

I've been searching for something like this for a while now. I've read a couple of essays and blogs and I have to say that it's with pretty great luck that I was able to stumble upon this. It will be truly helpful. Thanks a lot. Hope to learn more from you.

AAAAAAAAAAAAH, the .py.txt

AAAAAAAAAAAAH, the .py.txt is back.

fixed

Darn, sorry. I updated to Drupal 5.5 and because the issue is with the core file upload module, I missed it. Should be fixed!
Syndicate content