Post Reply 

Debugging Scripts

Apr 29, 2014, 18:13
Post: #1
Debugging Scripts
Hi there!
I'm trying to learn how to make plugins for GIMP, but the one thing I want to figure out first before I get everything set up is to find a good way to debug. Usually when I make a plugin or script for a browser, the console will give me a nice notification of what is happening and what line is causing the problem. Is there such a thing for gimp?
And are there any other methods out there that people like to use?
Find all posts by this user
Quote this message in a reply
Apr 29, 2014, 21:07
Post: #2
RE: Debugging Scripts
I found the python console and the error console, now I just can't get it to do anything. If I type it in GIMP's console I can get it to print the message, but trying to run the plugin won't do anything. Is it supposed to run this when I select it from the menu; it is appearing in the menu too, so I imagine that means the register is working. Smile
Code:
#!/usr/bin/env python

from gimpfu import *

def gp(message) :
    pdb.gimp_message(message)

def my_script_function() :
    gp("I am working!")

register(
    "easy_color_correct",    
    "Easy Color Corrector",  
    "Give your photo a warmer feel",
    "Corey Williams",
    "CC-A",
    "April 2014",
    "<Image>/Filters/Enhance/EZ Color",
    "*",
    [],
    [],
    my_script_function)

main()
Find all posts by this user
Quote this message in a reply
Apr 29, 2014, 23:39
Post: #3
RE: Debugging Scripts
How should I define these parameters (I figured that the console picked up the image automatically), and are you talking about the standard python print or gimp_message print, and by terminal are you talking about something similar to the command prompt on windows?


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Apr 30, 2014, 19:56
Post: #4
RE: Debugging Scripts
Thank you! Smile Also, it really didn't like not having image and drawable as parameters written in the actual script. Once I put those in it could run.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Scripts on making gore maps Elite Warrior 2 1,568 Aug 19, 2014 20:22
Last Post: winski
  pythons scripts do not appear michelk 2 831 Mar 2, 2014 19:26
Last Post: michelk
  Problems using python scripts prizmev 1 3,534 Mar 19, 2013 22:45
Last Post: prizmev
  Can't my find my scripts on Gimp 2.8 Pete 2 2,095 Jan 12, 2013 04:51
Last Post: shackra
  Is rippling animation reachable from scripts? Davide 3 1,361 Jun 1, 2012 17:21
Last Post: Davide

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS