Gimp-Forum.net

Full Version: How to get error messages in plugin registration?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am on Windows 10.

I remember having seen how to get error messages from registration of a Python plugin, but I don't find it. (I guess it was on Gimp-Forum.com?)

I am making a plugin. It runs ok in the console. When I try to registrate it, I get no error messages but it does not appear in Gimp's menu. When I feed the registration part (without the main()) in the console, no syntax errors are found. I cannot see any faults in the code.

This situation has happened many times in the past, and every time it takes a long time to find the errors without any help from error messages. So, please, tell me how I can get the error messages, and the simpler the method the better.
Thank you. This may be just the message I was remembering. I shall see to this and come back later.
I tried redirecting stderr and stdout but for some reason could not make it work.

But while trying I made some changes in the files, and the problem vanished! I don't understand, but am happy now (until next time...).

By the way, that page has the other advice, and there:

Code:
import sys; # extend the python path to include the plug-ins directory
sys.path=[gimp.directory+'/plug-ins']+sys.path #import the plugin import plugin

I do not understand this and am only guessing. But is it right? Should it not read:

Code:
import sys; # extend the python path to include the plug-ins directory
sys.path=[gimp.directory+'/plug-ins']+sys.path
import plugin  # import the plugin

I did not try. Just wondering.
Good guess. Fixed.