using inspect on pygtk

2007-09-28 Thread Chris Pax
Hello,

I recently been trying to use the inspect module to inspect the
arguments of gtk objects, such as gtk.Button. I tried like this:

inspect.getargspec(gtk.Button.__init__)

and get the fallowing error:

  File "", line 1, in 
  File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function


I have been trying to do this through code so that I don't have to
have a list of all possible gtk classes and their arguments.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: using inspect on pygtk

2007-10-01 Thread Chris Pax
On Sep 28, 9:57 pm, Chris Pax <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I recently been trying to use the inspect module to inspect the
> arguments of gtk objects, such as gtk.Button. I tried like this:
>
> inspect.getargspec(gtk.Button.__init__)
>
> and get the fallowing error:
>
>   File "", line 1, in 
>   File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
> raise TypeError('arg is not a Python function')
> TypeError: arg is not a Python function
>
> I have been trying to do this through code so that I don't have to
> have a list of all possible gtk classes and their arguments.

does anybody have any idea?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: using inspect on pygtk

2007-10-01 Thread Chris Pax
On Oct 1, 12:53 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> On 9/29/07, Chris Pax <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I recently been trying to use the inspect module to inspect the
> > arguments of gtk objects, such as gtk.Button. I tried like this:
>
> > inspect.getargspec(gtk.Button.__init__)
>
> > and get the fallowing error:
>
> >   File "", line 1, in 
> >   File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
> > raise TypeError('arg is not a Python function')
> > TypeError: arg is not a Python function
>
> What you are seeing is completely normal. inspect.getargspec(sys.exit)
> gives the same result. PyGTK is a wrapper around the GTK+ C library
> and since all the code is written in C, inspect can't infer anything
> about the function gtk.Button.__init__.
>
> --
> mvh Björn

ok thank you very much for answering my question.
so, i guess that there is no way to do this via code.. oh well

-- 
http://mail.python.org/mailman/listinfo/python-list