GNOME Bugzilla – Bug 559006
pybank & pyobject integration
Last modified: 2009-04-27 23:09:41 UTC
Work in progress patch to use pygobject in the pybank prototype. Uses PyGObject instances rather than python C object instances. I opted to use the __new__ slot for the primary constructor rather than __init__ -- it's a better choice and there isn't backward compatibility issues. new.instancemethod's are also used to define class methods rather than using __get__ to provide a property interface. Next step is hooking into more or pygobject's PyObject <--> C type code, for structs primarily but also to use more of the code for special cases.
Created attachment 121835 [details] [review] Patch
Oh, I didn't see this mail, as I'm not reading pygobject bugs any longer. But the changes looks great, please commit them to pybank.
Awesome! I'll take a look at this later tonight; I've been meaning to put together a blog about G-I and I'd like to use pybank in it.
I just committed this: Sending Makefile Sending bank/bank-argument.c Sending bank/bank-info.c Sending bank/bank.c Sending bank/btypes.py Sending bank/module.py Sending bank/repository.py Sending gtktest.py Transmitting file data ........ Committed revision 86.
I reverted this on trunk, as it broke some parts and I do not have time to look into it right now
Created attachment 131099 [details] [review] patch against pybank trunk r90 I'm attaching a patch that makes pybank trunk usable again. It's basically a flattening of the revisions in my bzr branch <https://code.launchpad.net/~malept/+junk/pybank> as of r94.
Committed attachment 131099 [details] [review] in revisions 91 and 92, with jdahlin's permission.
Created attachment 133451 [details] [review] an example patch I don't feel this is really fixed, this patch contains the modifications I've made so it feels good to me (there is another one for better enum support, but it's not yet working). It's not in a 'committable' state, but I'd like some thoughts. Here is what the patch actually does 1) registers wrappers with pygobject (it feels more natural to register them in the setter for pytype, but I couldn't do it). 2) add a __new__ methods for objects which don't provide one. 3) a little fix for _create_object (the type name isn't always namespaceprefix+name).
Hi, It's nice to see other people working on this. Just a few notes: Make sure when you submit your "final" patch, that you refrain from committing commented-out code. Could you attach some example Python code that shows off your improvements?
Also, if you want to discuss your other changes in real time, there's an IRC channel for pybank at <irc://irc.gnome.org/#pybank>. I'm particularly interested in your enum changes.