On Monday 13 January 2014 08:16:17 David Osguthorpe wrote: > I am using the python bindings - in fact was just going to see about > getting some patches to update the bindings. > > Just updated to 2.6.0 - looks as though some functions that used to > exist no longer exist in the Account class so need to be removed from > gnucash_business.py > > Ive noticed that the python bindings are not very "pythonic" - I have > some updates which improve this eg account lookup used to require > testing that the swig instance was None - this got updated somewhere > between 2.4 and 2.6 so now the python class returns None - the > "pythonic" way seems to me is to raise exception - which is what one > of my updates does > > So I was going to email this list to see what is going on with the > bindings and how such improvements could be added. > > Such updates will fail existing python code - such as the examples - > although Ive found other cases where existing changes means some of > the example python code no longer works > > David
There is no formal python-bindings maintainer but I do welcome and apply submitted improvements. So if you have fixes please do file an enhancement request in bugzilla [1] and attach your patches to it. John's reply does raise a valid issue with the python bindings: they are not easily portable to OS X and Windows and currently disabled on these platforms. That's why gnucash is not implementing any core functionality directly in python and patches in that direction will most likely be refused. Having said I do consider the python bindings a useful and powerful feature that can help integrate gnucash in other workflows, automate repetitive tasks, simplify complex steps and so on. In short: gnucash should not depend on python due to porting difficulties, but I support the idea of well developed python bindings as a tool for personal customisation (albeit exclusively on a limited set of platforms). Specifically to your suggestions: regarding returning "None" vs raising an exception, I have no opinion. I don't use python enough myself to know what would be the most typical python way of doing things. Ideally if you implement changes that break the examples, please include code that fixes the examples as well. They're about the only documentation that exists for the python bindings and it would be very confusing if they stopped working. I'm looking forward to your patches. Geert [1] http://wiki.gnucash.org/wiki/Bugzilla _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel