« Return to Thread: starting out developing with python-fu

Re: starting out developing with python-fu

by Sven Neumann :: Rate this Message:

Reply to Author | View in Thread

Hi,

On Mon, 2009-07-06 at 00:47 -0400, sergio wrote:

> i am currently working on figuring out how python fu works by  
> following some of the tutorials i see online..
>
> in trying to get a simple one running, and am having problems...
>
> running listing [1], i get:
>
> Traceback (most recent call last):
>    File "/opt/local/lib/gimp/2.0/python/gimpfu.py", line 801, in _run
>      res = apply(func, params[1:])
> TypeError: python_pytest() takes exactly 2 arguments (0 given)
>
> in the terminal window..
>
> any ideas?
>
> thanks!
>
>
>
>
>
> listing [1]
>
> #!/usr/bin/env python
>
> from gimpfu import *
>
> def python_pytest(img, layer) :
>      pdb.gimp_image_flip(img, ORIENTATION_VERTICAL)
>
> register(
>         "python_fu_pytest",
> "Does something",
> "Does something terribly useful",
> "Your name",
> "Your name",
> "2009",
> "Py Test...",
> "*",
> [
> ],
> [],
> python_pytest,
>          menu="<Image>/Filters/Distorts")
>
> main()

You register your script with zero parameters, but your python_pytest()
function takes two parameters. Just have a look at the scripts that ship
with GIMP.


Sven


_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

 « Return to Thread: starting out developing with python-fu