Writing gimp plugins in python on windows- how do i debug? where is the output?

Viewed 6641

EDITED HEAVILY with some new information (and a bounty)

I am trying to create a plug in in python for gimp. (on windows) this page http://gimpbook.com/scripting/notes.html suggests running it from the shell, or looking at ~/.xsession-errors

neither work. I am able to run it from the cmd shell, as

gimp-2.8.exe -c --verbose ## (as suggested by http://gimpchat.com/viewtopic.php?f=9&t=751 )

this causes the output from "pdb.gimp_message(...)" to go to a terminal.

BUT !!! this only works when everything is running as expected , i get no output on crashes.

i've tried print statements, they go nowhere.

this other guy had a similar problem , but the discussion got sidetracked. Plugins usually don't work, how do I debug?


in some places i saw recommendations to run it from within the python-fu console.

this gets me nowhere. i need to comment out import gimpfu, as it raises errors, and i don't get gtk working.


my current problem is that even if the plugin registers and shows on the menu, when there is some error and it does not behave as expected, i don't know where to start looking for hints . (i've tried clicking in all sorts of contexts, w - w/o selection, with w/o image. )

I was able to copy , and execute example plugins from http://gimpbook.com/scripting/ and i got the, working, but when a change i make breaks something, i know not what, and morphing an existing program line by line is tedious .(gimp has to be shut down and restared each time)


so to sum up -

1- can i refresh a plugin without restarting gimp ? (so at least my slow-morph will be faster )

2- can i run plug-ins from the python-fu shell. (as opposed to just importing them to make sure they parse.)

3- is there an error-log i am missing, or something to that effect?

4- is there a way to run gimp on windows from a shell to see output ? (am i better off under cygwin (or virtualbox.. ))?

5- i haven't yet looked up how to connect winpdb to an existing process. how would i go about connecting it to a python process that runs inside gimp?

thanks

3 Answers
Related