After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559006 - pybank & pyobject integration
pybank & pyobject integration
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 559001
Blocks:
 
 
Reported: 2008-11-02 22:57 UTC by John Ehresman
Modified: 2009-04-27 23:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (11.82 KB, patch)
2008-11-02 23:00 UTC, John Ehresman
none Details | Review
patch against pybank trunk r90 (4.84 KB, patch)
2009-03-21 20:03 UTC, Mark Lee
none Details | Review
an example patch (3.15 KB, patch)
2009-04-27 21:29 UTC, Abderrahim Kitouni
none Details | Review

Description John Ehresman 2008-11-02 22:57:20 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.
Comment 1 John Ehresman 2008-11-02 23:00:13 UTC
Created attachment 121835 [details] [review]
Patch
Comment 2 Johan (not receiving bugmail) Dahlin 2008-12-04 12:09:15 UTC
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.
Comment 3 Colin Walters 2008-12-04 17:45:04 UTC
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.
Comment 4 Johan (not receiving bugmail) Dahlin 2008-12-05 14:15:02 UTC
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.
Comment 5 Johan (not receiving bugmail) Dahlin 2009-01-15 22:35:10 UTC
I reverted this on trunk, as it broke some parts and I do not have time to look into it right now
Comment 6 Mark Lee 2009-03-21 20:03:10 UTC
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.
Comment 7 Mark Lee 2009-03-24 06:42:03 UTC
Committed attachment 131099 [details] [review] in revisions 91 and 92, with jdahlin's permission.
Comment 8 Abderrahim Kitouni 2009-04-27 21:29:41 UTC
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).
Comment 9 Mark Lee 2009-04-27 21:50:25 UTC
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?
Comment 10 Mark Lee 2009-04-27 23:09:41 UTC
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.