Python module prototype

Andy Clayton q3aiml at gmail.com
Wed Jan 26 01:03:00 EST 2011


So based off of the Interactive Javascript + Canvas (Flot) powered 
graphs thread:

Here's what I currently have for a python module. 
swig-core-ifdef-guile-fixes.patch should be fairly sane and possible to 
commit, but the rest has numerous rough edges and is quite ugly. Still, 
it might be enough to start playing with. The pycons patch throws in a 
python based gtk console that someone else wrote and opens it on launch. 
Optional, but fun to play with and see what works quite easily. Could 
possibly be put under a menu item visible with --extra in a more perfect 
world. There isn't much for examples except the little bit in the top of 
__init__.py (gnucash-python-mod.patch). This shows you how to grab the 
root account at least.

Two things to watch out for:
  1. I hardcoded the output of my python-config --ldflags into 
src/python/Makefile.am. Obviously this should be done with autoconfig, 
but I may try to convince everyone to switch over to CMake before 
dealing with that. I have some patches hanging out in my tree I'll 
submit for comments in the next few days.
  2. If you apply the pycons patch and install to a custom prefix, I 
have not set it up to correctly fiddle with the module path yet (if it 
even should). Thus, run it with something resembling 
PYTHONPATH=$GNC_PREFIX/lib/pythonX.Y/site-packages/ 
$GNC_PREFIX/bin/gnucash and so on...

Thanks,

Andy

On 01/24/2011 03:18 AM, Christian Stimming wrote:
> Am Samstag, 22. Januar 2011 schrieb Andy Clayton:
>> I do have an extremely simple module thrown
>> together so that python can be used from within gnucash,
> You have? I'd be interested to see that. Even if it can't be used for
> replacing scheme reports by python reports at this point in time, I would be
> interested to see whether other scriptable tasks within gnucash can be done
> through python already.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: swig-core-ifdef-guile-fixes.patch
Type: text/x-patch
Size: 3553 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20110126/aee608af/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-core-python-swig.patch
Type: text/x-patch
Size: 1964 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20110126/aee608af/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnucash-python-mod.patch
Type: text/x-patch
Size: 6375 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20110126/aee608af/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pycons.patch
Type: text/x-patch
Size: 54179 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20110126/aee608af/attachment-0007.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: series
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20110126/aee608af/attachment-0001.cc>


More information about the gnucash-devel mailing list