I've written several PyGimp plugins, but when I go to the 'recent filters' menu or try to rerun one, it is disabled. I can run it okay and it produces the expected results, but I can't rerun it.

to clarify, I'm using the simple gimpplugin.plugin class (GimpFu is far too heavyweight and slow for something with no UI needed)

Here's a super-simplified plugin just to demonstrate this.
How do I get it to be rerunnable?

(pasted here as well as attached, in case the attachment is filtered out by the mailing list software.)


#!/usr/bin/python
import gimp,gimpplugin
from gimpfu import PLUGIN, PF_INT, PF_IMAGE, PF_DRAWABLE, PDB_SUCCESS
pdb = gimp.pdb
import os

class Simple(gimpplugin.plugin):
    def query(self):
        d = ''
        gimp.install_procedure('plug_in_simple', d,d,d,d,d,'<Image>/File/Simple_Test', '',PLUGIN, [(
PF_INT, 'run_mode', "run mode"),(PF_IMAGE, 'image', 'Image'), (PF_DRAWABLE, 'drawable', 'Drawable')]
, [])

    def plug_in_simple(self, run_mode, image, drawable):
        return # returning PDB_SUCCESS doesn't help, nor does returning None (as gimpfu.py does)

    def start(self):
        gimpplugin.plugin.start(self)
       
if __name__ == '__main__':
    Simple().start()

#!/usr/bin/python
import gimp,gimpplugin
from gimpfu import PLUGIN, PF_INT, PF_IMAGE, PF_DRAWABLE, PDB_SUCCESS
pdb = gimp.pdb
import os

class Simple(gimpplugin.plugin):
    def query(self):
	d = ''
	gimp.install_procedure('plug_in_simple', d,d,d,d,d,'<Image>/File/Simple_Test', '',PLUGIN, [(PF_INT, 'run_mode', "run mode"),(PF_IMAGE, 'image', 'Image'), (PF_DRAWABLE, 'drawable', 'Drawable')], [])

    def plug_in_simple(self, run_mode, image, drawable):
	return # returning PDB_SUCCESS doesn't help, nor does returning None (as gimpfu.py does)

    def start(self):
	gimpplugin.plugin.start(self)
	
if __name__ == '__main__':
    Simple().start()
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to