[PATCH] python binding improvements

Mark Jenkins mark at parit.ca
Fri Sep 4 01:46:40 EDT 2009


Ahh, finally.

Attached are patches to the python bindings that I've actually had for 
awhile. Sending them upstream was somebody else's responsibility for so 
long that they were out of my field of attention once responsibility 
changed.

Today I opened up ParIT's svn repository, so if we're ever foolishly 
hoarding things again, you guys can just pull from us
http://svn.parit.ca/financial/gnucash

Our python binding work is in
http://svn.parit.ca/financial/gnucash/branches/python-bindings-2009-trunk

Apparently there's more work sitting in a working copy on the hard drive 
of a former colleague, some of which might even be the .i redundancy 
work that Derek suggested we engage in. I've this guy as another 
reminder that I'd really like to get my hands on that work, polish it, 
and get it here upstream where it belongs.


So, the patches are (in order of application)

python_GetNthChild_remove.patch
remove the redundant GetNthChild code, gnc_account_nth_child supported

python_more_GUID.patch
Improve support for GUID


python_better_commodity.patch
* Removed custom __init__ from GncCommodity, not only is it wrong but 
the one
from GnuCashCoreClass is just fine.

* Supported the get_table method For Book

* Removed support for direct instantiation of GncCommodityTable. (via
gnc_commodity_table_new() ). Only methods and not the constructor
function are added to the class now. Python binding users can access a
GncCommodityTable instance via Book.get_table() and have no need to use
gnc_commodity_table_new(), which the apis advise is for internal use
only.


python_GncLot.patch
* included gnc-lot.h in gnucash_core.i again

* Made GncLot class use superclass __init__, it doesn't need its own.


python_more_documentation.patch
Documentation strings for many classes, which can be viewed in source 
and with python's help() mechanism.


python_business_module_load.patch
load the business module, not the business module specific backend


python_example_scripts.py
example scripts improved, new one added.  This new script originally 
came from this post:
http://lists.gnucash.org/pipermail/gnucash-devel/2008-July/023618.html


python_authors_update.patch
added Legal Aid Manitoba to credit line for Mark Jenkins


My funding is coming from Legal Aid Manitoba, which has a very 
successful free software deployment. They are looking forward to adding 
GnuCash to their mix.
http://www.informit.com/articles/article.aspx?p=30590

I'd like to know if anyone has any trouble using 
--enable-python-bindings. Remember to use gnucash-env and to include the 
  directory containing the python gnucash module directory in your 
PYTHONPATH.


Mark Jenkins
Member
ParIT Worker Co-operative

cc Scott Balneaves, Legal Aid Manitoba
cc fellow ParITistas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_GetNthChild_remove.patch
Type: text/x-diff
Size: 868 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_more_GUID.patch
Type: text/x-diff
Size: 2561 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_better_commodity.patch
Type: text/x-diff
Size: 1762 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_GncLot.patch
Type: text/x-diff
Size: 942 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_more_documentation.patch
Type: text/x-diff
Size: 4773 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_business_module_load.patch
Type: text/x-diff
Size: 440 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_example_scripts.patch
Type: text/x-diff
Size: 4987 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_authors_update.patch
Type: text/x-diff
Size: 904 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090904/c2b9da8e/attachment-0007.bin>


More information about the gnucash-devel mailing list