Knowing how to call a specific function via PyGI



Hi,

When writing apps that use PyGI, what steps do people take to figure
out the exact way that code should be expressed in relation to the
original C API?

I know there are some good notes here:
http://live.gnome.org/PyGObject/IntrospectionPorting
but even after only writing a couple of small test apps, I ran into
difficulties that weren't addressed on that page.

For example, constants have tripped me up. I translated
GTK_STOCK_GO_FORWARD into PyGI by guesswork on first attempt at
gtk.STOCK_GO_FORWARD. But translating WEBKIT_LOAD_COMMITTED (from
http://webkitgtk.org/reference/WebKitWebFrame.html#WebKitLoadStatus)
really had me guessing hard for a good few minutes. In the end I found
it: WebKit.LoadStatus.COMMITTED

I'm wondering if there is a more systematic way to make such
translations so that my coding process does not rely so heavily on
guesswork. I imagine that if I had a simple list of all classes,
methods and constants available in
/usr/lib/girepository-1.0/WebKit-3.0.typelib then I could have solved
the above problem immediately (by simply searching the list for
'COMMITTED' or something).

Thanks,
Daniel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]