Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simulate debug breakpoints
#3
(03-03-2024, 05:13 PM)Ofnuts Wrote:
(03-03-2024, 01:56 AM)gimpygirl Wrote: Hi

Since it's not possible to debug a plugin on windows (maybe it can on linux?) I want to make a way to 'pause' execution of a plugin. Why I want to do that? I want to check in gimp if some code was executed correctly.
For example: I add an alpha channel to a layer in the code, and I then want to 'pause' and check in gimp if it's added by right clicking the layer. And then continue my code.

Is there a way I can pause the code by showing a message box (after the code line I want it to stop) or something that needs to be closed before the code continues? Or another way? Keyboard input is not possible I think?
Please note I'm making a plugin WITHOUT GUI.

Typically I raise an exception where I want the code to stop: raise Exception("Stopping after adding mask"), but my script run inside a try/except block. But this isn't a breakpoint since the code will never restart afterwards. The closest you can be to a break point is to make the code sleep a bit:

Code:
import time

time.sleep(10) # sleep 10 seconds

IS there a true way to debug gimp plugins? Either on windows or linux?
Reply


Messages In This Thread
simulate debug breakpoints - by gimpygirl - 03-03-2024, 01:56 AM
RE: simulate debug breakpoints - by Ofnuts - 03-03-2024, 05:13 PM
RE: simulate debug breakpoints - by gimpygirl - 03-03-2024, 06:21 PM
RE: simulate debug breakpoints - by Ofnuts - 03-03-2024, 09:04 PM
RE: simulate debug breakpoints - by gimpygirl - 03-04-2024, 02:40 AM
RE: simulate debug breakpoints - by Ofnuts - 03-04-2024, 08:49 AM

Forum Jump: