Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get error messages in plugin registration?
#1
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.
Reply
#2
Is this post any help?

https://www.gimp-forum.net/Thread-Debugg...in-Windows
Reply
#3
Thank you. This may be just the message I was remembering. I shall see to this and come back later.
Reply
#4
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.
Reply
#5
Good guess. Fixed.
Reply


Forum Jump: