Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python-Fu - pdb.query ; how to filter to readable output
#2
UPDATE:

I thought to try the more complete string:

re.findall("gimp_image_grid_set",str(dir(pdb)))

and that returned five hits. The tutorial gave me three of them, so I just did a brute-force search, going through the alphabet::

re.findall("gimp_image_grid_set_a",str(dir(pdb)))

resulted in nothing.

re.findall("gimp_image_grid_set_b",str(dir(pdb)))

gave me a hit. So I moved on to the next charavter, starting the alphabet over again at "a":

re.findall("gimp_image_grid_set_ba",str(dir(pdb)))

Getting another successful hit, I guessed this was going to be "background", so I tried

re.findall("gimp_image_grid_set_back",str(dir(pdb)))

worked, and

re.findall("gimp_image_grid_set_background",str(dir(pdb)))

worked. Continuing like this, I found the two missing attributes/properties are:

gimp_image_grid_set_background_color()

and

gimp_image_grid_set_foreground_color()

With further experimenting (googling didn't reveal the syntax), I found I can set the color with either:

pdb.gimp_image_grid_set_foreground_color(theImage, "red")

or

pdb.gimp_image_grid_set_foreground_color(theImage, "#FF0000")

But brute-force searching is a dirty hack; I need to know how to properly find the attributes/properties of an abject, and how to use them.

Thanks!

--
Kent
Reply


Messages In This Thread
RE: Python-Fu - pdb.query ; how to filter to readable output - by DebianFanatic - 10-07-2018, 01:23 AM

Forum Jump: