Re: Issues with GList Arguments in Python Bindings?

2025-03-09 Thread Oliver Trevor
: Issues with GList Arguments in Python Bindings? On Mar 8, 2025, at 14:57, Oliver Trevor wrote: Hello Gnucash developers, I was attempting to use the Gnucash Python bindings to apply payments to a list of invoices using Customer.ApplyPayment (which maps to gncOwnerApplyPaymentSecs on

Re: Issues with GList Arguments in Python Bindings?

2025-03-08 Thread John Ralls
> On Mar 8, 2025, at 14:57, Oliver Trevor wrote: > > Hello Gnucash developers, > > I was attempting to use the Gnucash Python bindings to apply payments > to a list of invoices using Customer.ApplyPayment (which maps to > gncOwnerApplyPaymentSecs on the C side),

Issues with GList Arguments in Python Bindings?

2025-03-08 Thread Oliver Trevor
Hello Gnucash developers, I was attempting to use the Gnucash Python bindings to apply payments to a list of invoices using Customer.ApplyPayment (which maps to gncOwnerApplyPaymentSecs on the C side), but it gives an error "TypeError: in method 'gncOwnerApplyPaymentSecs'

Re: [GNC-dev] Python bindings: "invalid unclassed pointer in cast to 'QofInstance'"

2023-05-23 Thread John Ralls
Looks like there's a bad pointer somewhere. Please open a bug report. Regards, John Ralls > On May 23, 2023, at 09:36, Steve Brown wrote: > > I get the following errors/warnings when using ApplyPayment to a > customer. > > * 06:56:27 WARN invalid unclassed pointer in cast to > 'QofInstance

[GNC-dev] Python bindings: "invalid unclassed pointer in cast to 'QofInstance'"

2023-05-23 Thread Steve Brown
I get the following errors/warnings when using ApplyPayment to a customer. * 06:56:27 WARN invalid unclassed pointer in cast to 'QofInstance' * 06:56:27 ERROR QofBook* qof_instance_get_book(gconstpointer): assertion 'QOF_IS_INSTANCE(inst)' failed * 06:56:27 WARN invalid unclassed pointer in

Re: [GNC-dev] Python bindings: How to expose additional engine functions

2023-01-27 Thread john
ddress from a >>>>> transaction. >>>>> The transaction is found by guid. >>>>> >>>>> Exposing guid_from_string() was pretty straightforward as was >>>>> GetLot() >>>>> and GetFirstAPARAcctSplit(). >>>

Re: [GNC-dev] Python bindings: How to expose additional engine functions

2023-01-25 Thread john
o return the result and indicate failure by returning >>> NULL. >> >> Yes, but SWIG makes it pretty simple, see >> https://www.swig.org/Doc3.0/Python.html#Python_nn46. >> Note that you can still have the bool rv to test success. >> >>> I also no

Re: [GNC-dev] Python bindings: How to expose additional engine functions

2023-01-25 Thread Steve Brown
have the bool rv to test success. > > > I also noticed that there is a problem with gnc- > > session.c:gnc_get_current_session() using the bindings. In the > > executable, gnc_set_current_session() is called in gnc_file.c after > > each qof_session_new(). But with

Re: [GNC-dev] Python bindings: How to expose additional engine functions

2023-01-24 Thread John Ralls
c:gnc_get_current_session() using the bindings. In the > executable, gnc_set_current_session() is called in gnc_file.c after > each qof_session_new(). But with the Python bindings, the swig- > generated code calls qof_session_new(). So, current_session isn't > ini

[GNC-dev] Python bindings: How to expose additional engine functions

2023-01-24 Thread Steve Brown
that there is a problem with gnc- session.c:gnc_get_current_session() using the bindings. In the executable, gnc_set_current_session() is called in gnc_file.c after each qof_session_new(). But with the Python bindings, the swig- generated code calls qof_session_new(). So, current_session isn't i

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread john
gncOwnerCreatePaymentLotSecs is a bad design because it tries to fit two use cases. One, in gncInvoiceApplyPayment, has a transaction already and passes it to gncOwnerCreatePaymentLotSecs. That's OK. The other, in gnc_payment_ok_cb via gncOwnerApplyPayemtSecs, asks it to create a transaction

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread Matteo Lasagni
Thank you Derek, I understand what you mean. The point here is that I was not interested in the value returned through the pointer, but only in making that function callable from Python. I was looking for a solution to automatically associate multiple invoices to the same transaction, as it is poss

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread Derek Atkins
More specifically... The issue here is that there are multiple return values. gncOwnerCreatePaymentLotSecs() is *RETURNING* both a GNCLot* and a Transaction*. However, C doesn't allow you to do that, so the function returns the GNCLot* and assigns the Transaction* to the Transaction** argument

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread Derek Atkins
Hi, A "Transaction**" means that the new Transaction is a "return value" (it's unlikely that it would be asking for an array of Transaction* pointers). Your best bet is to write a swig/python wrapper that returns a Transaction*, possibly in a tuple with the current return value of the function.

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread Matteo Lasagni
If I can find a good solution, yes, I will put it in a pull request. I have tried to encapsulate Transaction* in a list, but of course it doesn't work without touching swig definitions. I am now trying to create a specific typemap for handling the double pointer. I think this would be the cleanest

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread john
> On May 10, 2022, at 1:53 AM, Matteo Lasagni wrote: > > Thank you, John! > > I fixed it by adding the following into base-typemaps.i: > > %typemap(in) GList * { > $1 = NULL; > /* Check if is a list */ > if (PyList_Check($input)) { > int i; > int size = PyList_Siz

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-10 Thread Matteo Lasagni
Thank you, John! I fixed it by adding the following into base-typemaps.i: %typemap(in) GList * { $1 = NULL; /* Check if is a list */ if (PyList_Check($input)) { int i; int size = PyList_Size($input); for (i = size-1; i >= 0; i--) { PyObject *o = PyL

Re: [GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-09 Thread John Ralls
> On May 9, 2022, at 2:17 PM, Matteo Lasagni wrote: > > Hi, > I am writing a python script to automatically associate a set of > invoices to a single transaction. > To this end, I am trying to use the function AutoApplyPaymentsWithLots > with no success: > > > lots = [lot1, lot2, lotn, ..] >

[GNC-dev] Python-Bindings: issue when C expects GList argument

2022-05-09 Thread Matteo Lasagni
Hi, I am writing a python script to automatically associate a set of invoices to a single transaction. To this end, I am trying to use the function AutoApplyPaymentsWithLots with no success: lots = [lot1, lot2, lotn, ..] owner.AutoApplyPaymentsWithLots(lots) This causes the following error: Typ

[GNC-dev] python bindings: how to create a new security?

2021-05-20 Thread Lipp F.
Hi everyone, I need to create a new security. I have looked under gnucash/bindings/python/example_scripts/ and I couldn't find anything. Can you guys give me some directions? Thanks. ___ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists

Re: [GNC-dev] GnuCash python bindings - API description

2020-10-19 Thread Manfred Usselmann
r the source code which I could analyze to retrieve this information. The sources are at https://github.com/gnucash/Gnucash. The API documentation is at https://code.gnucash.org/docs/MAINT. There is not much separate documentation for the python bindings, best to read the comments in the sources, bin

Re: [GNC-dev] GnuCash python bindings - API description

2020-10-19 Thread John Ralls
to find a description of what is available > or the source code which I could analyze to retrieve this information. The sources are at https://github.com/gnucash/Gnucash. The API documentation is at https://code.gnucash.org/docs/MAINT. There is not much separate documentation for the python

[GNC-dev] GnuCash python bindings - API description

2020-10-19 Thread Manfred Usselmann
Hi, I've just started to use the python interface again after several years and the following methods of the Transaction object seem to be no longer available: SetDateEnteredTS() SetDatePostedTS() Is there any description of the available methods and properties? I only found https://code.g

Re: [GNC-dev] Python bindings: Exception when calling GetDatePosted on unposted invoice

2019-02-06 Thread Frank Oltmanns
4. > >Regards, > >Geert > >Op woensdag 6 februari 2019 19:19:57 CET schreef Frank Oltmanns: >> Dear all, >> >> I'm using the python bindings from GnuCash 3.3 (debian package from >sid). >> When calling GetDatePosted() on an unposted invoice a get the &

Re: [GNC-dev] Python bindings: Exception when calling GetDatePosted on unposted invoice

2019-02-06 Thread Geert Janssens
Hi Frank, I believe this is https://bugs.gnucash.org/show_bug.cgi?id=796893 That bug has been fixed for gnucash 3.4. Regards, Geert Op woensdag 6 februari 2019 19:19:57 CET schreef Frank Oltmanns: > Dear all, > > I'm using the python bindings from GnuCash 3.3 (debian pa

[GNC-dev] Python bindings: Exception when calling GetDatePosted on unposted invoice

2019-02-06 Thread Frank Oltmanns
Dear all, I'm using the python bindings from GnuCash 3.3 (debian package from sid). When calling GetDatePosted() on an unposted invoice a get the following exception: ValueError: month must be in 1..12 This function is used in the example scripts that are part of GnuCash (gnucash_simple.py

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-09-04 Thread c . holtermann
Am 2018-07-10 20:58, schrieb David Osguthorpe: Hi All, In upgrading to gnucash 3.2 from 2.6.18 and updating my python scripts I have found an issue with the gnucash bindings and python 3. I saw this with query runs that failed to produce any results when they should have, and used to under

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-09-04 Thread c . holtermann
Hello all, I just realized (because John showed me) that this bug report: https://bugs.gnucash.org/show_bug.cgi?id=796137 and this mail thread are related. regards, Christoph Am 2018-07-19 15:42, schrieb Derek Atkins: John Ralls writes: Funny... 15+ years ago it WAS an Enum, but changed

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-19 Thread Derek Atkins
John Ralls writes: >> Funny... 15+ years ago it WAS an Enum, but changed to a string because >> we wanted to enable searching on plug-in modules. > > OK, and enums are immune to run-time changes implied by a plugin > module, but there are better ways than strings to tag types. Glib > provides Gq

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-16 Thread John Ralls
> On Jul 16, 2018, at 10:09 AM, Derek Atkins wrote: > > John Ralls writes: > >>> When it moves to C++ you can just use std::string. :) >> >> An enum would be safer, faster, smaller, more intuitive, and wouldn’t >> break swig. > > Funny... 15+ years ago it WAS an Enum, but changed to a str

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-16 Thread Derek Atkins
John Ralls writes: >> When it moves to C++ you can just use std::string. :) > > An enum would be safer, faster, smaller, more intuitive, and wouldn’t > break swig. Funny... 15+ years ago it WAS an Enum, but changed to a string because we wanted to enable searching on plug-in modules. > Regard

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-12 Thread John Ralls
> On Jul 12, 2018, at 7:23 AM, Derek Atkins wrote: > > John Ralls writes: > >>> PS. Another solution would be to force byte string only arguments for >>> python 3 using a SWIG define SWIG_PYTHON_STRICT_BYTE_CHAR. >>> >>> This would require a major re-write of the gnucash_core.py to perform t

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-12 Thread Derek Atkins
John Ralls writes: >> PS. Another solution would be to force byte string only arguments for >> python 3 using a SWIG define SWIG_PYTHON_STRICT_BYTE_CHAR. >> >> This would require a major re-write of the gnucash_core.py to perform the >> unicode<->byte transformations. > > ISTM it would be better

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-10 Thread David Osguthorpe
OK Will file a bug - plus file a fix for GSList which is still needed. David On Tue, Jul 10, 2018 at 10:28 PM, John Ralls wrote: > > > > On Jul 10, 2018, at 11:58 AM, David Osguthorpe < > david.osgutho...@gmail.com> wrote: > > > > Hi All, > > > > > > In upgrading to gnucash 3.2 from 2.6.18 and

Re: [GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-10 Thread John Ralls
> On Jul 10, 2018, at 11:58 AM, David Osguthorpe > wrote: > > Hi All, > > > In upgrading to gnucash 3.2 from 2.6.18 and updating my python scripts I > have found an issue with the gnucash bindings and python 3. > > > I saw this with query runs that failed to produce any results when they

[GNC-dev] Problems with python 3 and the gnucash python bindings.

2018-07-10 Thread David Osguthorpe
Hi All, In upgrading to gnucash 3.2 from 2.6.18 and updating my python scripts I have found an issue with the gnucash bindings and python 3. I saw this with query runs that failed to produce any results when they should have, and used to under 2.6.18. So far it appears the issue is with the w

Re: Python bindings and Gtk3

2017-08-10 Thread Mike Alexander
> On Aug 10, 2017, at 3:22 AM, John Ralls wrote: > > 3.22.what? I pushed the change to gtk that caused the pango breakage between > 3.22.11 and 3.22.12 so 3.22.11 wouldn't have had the problem... and of course > if pango is using the fontconfig backend it shouldn't manifest anyway. Of > course

Re: Python bindings and Gtk3

2017-08-10 Thread John Ralls
> On Aug 10, 2017, at 12:31 AM, Mike Alexander wrote: > >> On Aug 9, 2017, at 1:49 PM, John Ralls wrote: >> >> Hmm, looks like both whitespace and font are larger. What version of Gtk+-3? >> > > It’s version 3.22. > >> Hmm, looks like both whitespace and font are larger. What version of Gtk

Re: Python bindings and Gtk3

2017-08-09 Thread Mike Alexander
> On Aug 9, 2017, at 1:49 PM, John Ralls wrote: > > Hmm, looks like both whitespace and font are larger. What version of Gtk+-3? > It’s version 3.22. > Hmm, looks like both whitespace and font are larger. What version of Gtk+-3? > > You can try fiddling with the tab-label styling in ~/.config

Re: Python bindings and Gtk3

2017-08-09 Thread John Ralls
> On Aug 9, 2017, at 7:28 AM, Mike Alexander wrote: > >> On Aug 9, 2017, at 12:21 AM, Mike Alexander > > wrote: >> >>> On Aug 8, 2017, at 10:23 AM, John Ralls >> > wrote: >>> >>> I don't know if the MacPorts X-build uses the CoreText

Re: Python bindings and Gtk3

2017-08-09 Thread Derek Atkins
Mike, Mike Alexander writes: > I guess attachments aren’t allowed, I should have known. The > screenshots are at *attachments* are allowed *INLINE* images are not. -derek -- Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory Member, MIT Student Information Processing Boa

Re: Python bindings and Gtk3

2017-08-08 Thread Mike Alexander
> On Aug 9, 2017, at 12:21 AM, Mike Alexander wrote: > >> On Aug 8, 2017, at 10:23 AM, John Ralls >> wrote: >> >> I don't know if the MacPorts X-build uses the CoreText or FontConfig backend >> for Pango, but if it uses CoreText it might be your problem. > > I don’t know either. I see that

Re: Python bindings and Gtk3

2017-08-08 Thread Mike Alexander
> On Aug 8, 2017, at 10:23 AM, John Ralls wrote: > > I don't know if the MacPorts X-build uses the CoreText or FontConfig backend > for Pango, but if it uses CoreText it might be your problem. I don’t know either. I see that Pango’s configure looks for (and finds) fontconfig, but then says "c

Re: Python bindings and Gtk3

2017-08-08 Thread John Ralls
> On Aug 8, 2017, at 6:17 AM, Mike Alexander wrote: > >> On Aug 7, 2017, at 8:51 PM, Sumit Bhardwaj wrote: >> >> For the tab issue, can you share a screenshot or something to that effect? I >> am on master build and have tabs on right-hand side as well, but it's >> perfectly usable. >> > >

Re: Python bindings and Gtk3

2017-08-07 Thread Geert Janssens
On dinsdag 8 augustus 2017 05:17:09 CEST Mike Alexander wrote: > > On Aug 7, 2017, at 8:51 PM, Sumit Bhardwaj wrote: > > > > For the tab issue, can you share a screenshot or something to that effect? > > I am on master build and have tabs on right-hand side as well, but it's > > perfectly usable.

Re: Python bindings and Gtk3

2017-08-07 Thread Mike Alexander
> On Aug 7, 2017, at 8:51 PM, Sumit Bhardwaj wrote: > > For the tab issue, can you share a screenshot or something to that effect? I > am on master build and have tabs on right-hand side as well, but it's > perfectly usable. > It’s certainly usable, I didn’t mean to imply otherwise. It’s jus

Re: Python bindings and Gtk3

2017-08-07 Thread Sumit Bhardwaj
ander wrote: > You may already know this, but the Python bindings done’t work in the > current master branch (they still use Gtk2). I made a brief attempt to fix > this, but I don’t know either Python or Gtk3 well enough. > > I also noticed a cosmetic issue that you may not be aware

Python bindings and Gtk3

2017-08-07 Thread Mike Alexander
You may already know this, but the Python bindings done’t work in the current master branch (they still use Gtk2). I made a brief attempt to fix this, but I don’t know either Python or Gtk3 well enough. I also noticed a cosmetic issue that you may not be aware of because I use a non-default

Re: Compile on Windows with Python Bindings

2016-10-13 Thread Rob Gowin
On Wed, Oct 12, 2016 at 3:21 PM, Adam wrote: > > * 21:17:31 OTHER No GSettings schemas are installed on the > system > > Any thoughts on where I might be going wrong? Is trying to compile with > Python bindings a lost cause? Hi Adam, I don't have anything to offer

Re: Compile on Windows with Python Bindings

2016-10-12 Thread Geert Janssens
On Wednesday 12 October 2016 22:36:44 John Ralls wrote: > > On Oct 12, 2016, at 10:21 PM, Adam > > wrote: > > > > I am compiling gnucash in Windows using MinGW in order to include > > the Python bindings. I have been using 2.6.14 release source code > > from

Re: Compile on Windows with Python Bindings

2016-10-12 Thread John Ralls
> On Oct 12, 2016, at 10:21 PM, Adam wrote: > > I am compiling gnucash in Windows using MinGW in order to include the > Python bindings. I have been using 2.6.14 release source code from Git. > > I have arrived at step 10 in the python-bindings sections but now have 3 >

Compile on Windows with Python Bindings

2016-10-12 Thread Adam
I am compiling gnucash in Windows using MinGW in order to include the Python bindings. I have been using 2.6.14 release source code from Git. I have arrived at step 10 in the python-bindings sections but now have 3 issues: 1) I get the following error message when attempting to run gnucash

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-15 Thread Marcus Wellnitz
ump, no Stacktrace! > > > > Is this code by any chance used the create a new xml file ? In other words does input_url refer to a non-existing file ? > No! This code only creates a session object (connected to the gnucash instance, MySQL) I can follow the code up to the python-c-in

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-15 Thread John Ralls
> On Dec 15, 2014, at 8:09 AM, Marcus Wellnitz wrote: > > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hello John, >>> Hello John, >>> >>> I've never used the git repoitory. It's all plain Ubuntu code plus >>> micha's repository: >>> deb http://ppa.launchpad.net/micha/libaqbanking/ub

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-15 Thread Geert Janssens
re_lock) > > ==> Coredump, no Stacktrace! Is this code by any chance used the create a new xml file ? In other words does input_url refer to a non-existing file ? I have recently pushed a fix [1] to the python bindings that should prevent it from crashing when trying to create a new xml

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-15 Thread Marcus Wellnitz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello John, >> Hello John, >> >> I've never used the git repoitory. It's all plain Ubuntu code plus >> micha's repository: >> deb http://ppa.launchpad.net/micha/libaqbanking/ubuntu trusty main >> >> I'll check if a self-build GnuCash will eleminate th

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-15 Thread John Ralls
> On Dec 14, 2014, at 11:20 PM, Marcus Wellnitz > wrote: > > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hello John, > > I've never used the git repoitory. It's all plain Ubuntu code plus > micha's repository: > deb http://ppa.launchpad.net/micha/libaqbanking/ubuntu trusty main >

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-14 Thread Marcus Wellnitz
>> Mo, 10. Nov 2014 20:11:40 +0200 >> [AKTUALISIERUNG] python3-uno:amd64 1:4.2.6.3-0ubuntu1 -> 1:4.2.7-0ubuntu1 >> >> >> Maybe someone can help me? > > Since the only changes on maint between 3 and 10 November were translations and in Guile, I suppose th

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-14 Thread John Ralls
> On Dec 14, 2014, at 7:18 PM, Mike Alexander wrote: > > --On December 14, 2014 at 7:02:15 AM -0800 John Ralls > wrote: > >> Did you regenerate the swig files? You'll need to do that often on >> master. If you build in a separate directory you'll need to `git >> clean -fdx` in your source dir

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-14 Thread Mike Alexander
--On December 14, 2014 at 7:02:15 AM -0800 John Ralls wrote: Did you regenerate the swig files? You'll need to do that often on master. If you build in a separate directory you'll need to `git clean -fdx` in your source directory then re-run autogen.sh and configure. If you build in-source `ma

Re: python-bindings: coredump whil executing gnucash.Session

2014-12-14 Thread John Ralls
and in Guile, I suppose that you're using master. We landed Aaron's KvpFrame reimplementation on 3 November and nothing much else through the 10th. Did you regenerate the swig files? You'll need to do that often on master. If you build in a separate directory you'll need t

python-bindings: coredump whil executing gnucash.Session

2014-12-14 Thread Marcus Wellnitz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I've made some improvements with the latex-invoice examples and got it working for my Ubuntu 14.04 LTS environment. (Mostly adapted to new python version) It worked until some updates between November 3 and November 10. I could not handle to

Re: Python Bindings

2014-06-01 Thread Marc Shapiro
On 05/31/2014 03:43 PM, John Ralls wrote: On May 31, 2014, at 3:14 PM, Marc Shapiro wrote: Ooops! I meant to send this to the list. Marc - All in all it sounds like it would be a lot more work that I am really up to at this time. Of course, learning Scheme/Guile is not re

Re: Python Bindings

2014-05-31 Thread John Ralls
On May 31, 2014, at 3:14 PM, Marc Shapiro wrote: > Ooops! I meant to send this to the list. > > Marc > > - > > All in all it sounds like it would be a lot more work that I am really up to > at this time. Of course, learning Scheme/Guile is not really any better. > > What I

Re: Python Bindings

2014-05-31 Thread Marc Shapiro
And I did it again! Sorry, John and David. On 05/31/2014 03:14 PM, Marc Shapiro wrote: Ooops! I meant to send this to the list. Marc - All in all it sounds like it would be a lot more work that I am really up to at this time. Of course, learning Scheme/Guile is not really

Re: Python Bindings

2014-05-31 Thread David Osguthorpe
On Sat, May 31, 2014 at 12:27:25PM -0700, John Ralls wrote: > > Why not instead add python to the swig files for the API that you need? It's > only one header, gnc-budget.h, and you can use the Guile adapter code in > src/engine/engine.i as a guide. > not quite as simple as this - I added gnc-

Re: Python Bindings

2014-05-31 Thread David Osguthorpe
es in python working in the main gnucash GUI. However, this is totally de-coupled from the scheme report system - you end up writing into a gtk window - you can use pygtk or webkit python bindings at the moment this does seem to work and I think is going to be the better way of actually writing repor

Re: Python Bindings

2014-05-31 Thread John Ralls
in the future I might look at integrating it/them better. >> >> I haven't yet looked at Budget info or Future transactions neither with the >> bindings or gnucash itself. If I understood things a little more I'd guess >> that currently the bindings for thes

Re: Python Bindings

2014-05-31 Thread Marc Shapiro
se aren't there. If you look at http://svn.gnucash.org/docs/head/annotated.html and expand python-bindings it might give a flavour for what's currently covered. Once I'm more comfortable with what I'm doing/done I will document it for the greater good. Kind regards AnG

Re: Python Bindings

2014-05-27 Thread angus
Hi again Managed to sort out my problem. The interface for getting an account changed behaviour so I've changed how I get them and it all seems OK. Kind regards AnGus On 23/05/14 18:23, angus wrote: Hi People I've been using the Python bindings for gnucash quite successfully fo

Python Bindings

2014-05-23 Thread angus
Hi People I've been using the Python bindings for gnucash quite successfully for about a year, however, ... I've just updated my Ubuntu system to 14.4 (Trusty) and the bindings no longer work. I can't even do a simple 'account.GetType()'. If somebody could point me in

Re: Make check files with python bindings.

2014-05-22 Thread John Ralls
On 22 May 2014, at 00:12, Thomas Klausner wrote: > On Sat, May 17, 2014 at 10:19:52AM -0700, John Ralls wrote: >> While we're on the subject of runTests.py, we've got a configure >> substitution for the shebang. Is there some platform (MinGW maybe?) where >> `#!/usr/bin/env python` doesn't wor

Re: Make check files with python bindings.

2014-05-22 Thread Thomas Klausner
On Sat, May 17, 2014 at 10:19:52AM -0700, John Ralls wrote: > While we're on the subject of runTests.py, we've got a configure substitution > for the shebang. Is there some platform (MinGW maybe?) where `#!/usr/bin/env > python` doesn't work? There are platforms where "python" doesn't exist, onl

Re: Make check files with python bindings.

2014-05-18 Thread Mike Evans
On Sat, 17 May 2014 16:43:23 -0700 John Ralls wrote: > > On May 17, 2014, at 4:34 AM, Mike Evans wrote: > > > On Sat, 17 May 2014 13:06 +0200 > > Geert Janssens wrote: > > > >> Do you have the python-test package installed ? Fedora has separated the > >> test support from python-devel. I ra

Re: Make check files with python bindings.

2014-05-17 Thread John Ralls
On May 17, 2014, at 4:34 AM, Mike Evans wrote: > On Sat, 17 May 2014 13:06 +0200 > Geert Janssens wrote: > >> Do you have the python-test package installed ? Fedora has separated the >> test support from python-devel. I ran into this a few months back on >> Fedora 19 (20?) as well. >> >> Ge

Re: Make check files with python bindings.

2014-05-17 Thread John Ralls
On May 17, 2014, at 4:34 AM, Mike Evans wrote: > On Sat, 17 May 2014 13:06 +0200 > Geert Janssens wrote: > >> Do you have the python-test package installed ? Fedora has separated the >> test support from python-devel. I ran into this a few months back on >> Fedora 19 (20?) as well. >> >> Ge

Re: Make check files with python bindings.

2014-05-17 Thread Mike Evans
s wrote: > > > On May 16, 2014, at 9:24 AM, Mike Evans > wrote: > > > > make check-TESTS > > > > make[1]: Entering directory > > > > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/ > > > > tests'> > &g

Re: Make check files with python bindings.

2014-05-17 Thread Geert Janssens
e: > > On May 16, 2014, at 9:24 AM, Mike Evans wrote: > > > make check-TESTS > > > make[1]: Entering directory > > > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/ > > > tests'> > > > > Traceback (most recent call las

Re: Make check files with python bindings.

2014-05-17 Thread Mike Evans
On Fri, 16 May 2014 11:38:59 -0700 John Ralls wrote: > > On May 16, 2014, at 9:24 AM, Mike Evans wrote: > > > make check-TESTS > > make[1]: Entering directory > > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/tests' > > Traceb

Re: Make check files with python bindings.

2014-05-16 Thread John Ralls
On May 16, 2014, at 9:24 AM, Mike Evans wrote: > make check-TESTS > make[1]: Entering directory > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/tests' > Traceback (most recent call last): > File "./runTests.py", line 8, in >from t

Make check files with python bindings.

2014-05-16 Thread Mike Evans
make check-TESTS make[1]: Entering directory `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/tests' Traceback (most recent call last): File "./runTests.py", line 8, in from test import ImportError: cannot import name test_support FA

Re: Python bindings: patch, documentation, examples

2014-05-09 Thread Marc Shapiro
required - just a user prototype.scm file) Can you post what libraries you used, where you got them, how to use them and your prototype.scm file. Also, any pointers to useful documentation for using the Python bindings would be greatly appreciated. I am primarily interested (at the moment) in

Re: Python bindings: patch, documentation, examples

2014-05-09 Thread David Osguthorpe
- just a user prototype.scm file) > > Can you post what libraries you used, where you got them, how to use them > and your prototype.scm file. Also, any pointers to useful documentation for > using the Python bindings would be greatly appreciated. I am primarily > interes

Re: Python bindings: patch, documentation, examples

2014-05-08 Thread mshapiro
you got them, how to use them and your prototype.scm file. Also, any pointers to useful documentation for using the Python bindings would be greatly appreciated. I am primarily interested (at the moment) in accessing budgeting information and future transactions, as well as accounts, since I would lik

Re: Python bindings: Account.getName() raises TypeError

2014-03-19 Thread Geert Janssens
On Tuesday 18 March 2014 07:28:56 John Ralls wrote: > My point is that Python barely knows about type at all, except for its own > built-in types [1]. It will raise a TypeError if you try to divide a string, like this: > >>> 'foo' / 3 > > Traceback (most recent call last): > File "", line 1, i

Re: Python bindings: Account.getName() raises TypeError

2014-03-18 Thread John Ralls
On Mar 18, 2014, at 6:30 AM, Derek Atkins wrote: > John Ralls writes: > >> On Mar 17, 2014, at 10:52 AM, Derek Atkins wrote: >> >>> John Ralls writes: >>> > TypeError: in method 'xaccAccountGetName', argument 1 of type > Account const *' >>> [snip] The signature of xaccA

Re: Python bindings: Account.getName() raises TypeError

2014-03-18 Thread Derek Atkins
John Ralls writes: > On Mar 17, 2014, at 10:52 AM, Derek Atkins wrote: > >> John Ralls writes: >> TypeError: in method 'xaccAccountGetName', argument 1 of type Account const *' >> [snip] >>> >>> The signature of xaccAccountGetName is const char* xaccAccountGetName >>> (const Account

Re: Python bindings: Account.getName() raises TypeError

2014-03-18 Thread Mike Evans
On Mon, 17 Mar 2014 10:32:17 + Mike Evans wrote: > On Mon, 17 Mar 2014 11:26:30 +0100 > Felix Schwarz wrote: > > > > > Am 17.03.2014 11:21, schrieb Mike Evans: > > > new_book_with_opening_balances.py works for me too on Fedora18 and SWIG > > > Version 2.0.8. > > > > Which version of gnuc

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread John Ralls
On Mar 17, 2014, at 10:52 AM, Derek Atkins wrote: > John Ralls writes: > >>> TypeError: in method 'xaccAccountGetName', argument 1 of type >>> Account const *' > [snip] >> >> The signature of xaccAccountGetName is const char* xaccAccountGetName >> (const Account *); the const was added in 200

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread Derek Atkins
John Ralls writes: >> TypeError: in method 'xaccAccountGetName', argument 1 of type >> Account const *' [snip] > > The signature of xaccAccountGetName is const char* xaccAccountGetName > (const Account *); the const was added in 2005. A "const Account *" is > not the same as an "Account const *":

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread Geert Janssens
On Monday 17 March 2014 10:21:16 Mike Evans wrote: > On Sun, 16 Mar 2014 13:41:42 -0700 > > David Osguthorpe wrote: > > On Sun, Mar 16, 2014 at 08:54:10PM +0100, Felix Schwarz wrote: > > > Am 16.03.2014 20:38, schrieb John Ralls: > > > > The signature of xaccAccountGetName is const char* > > > >

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread Mike Evans
On Mon, 17 Mar 2014 11:26:30 +0100 Felix Schwarz wrote: > > Am 17.03.2014 11:21, schrieb Mike Evans: > > new_book_with_opening_balances.py works for me too on Fedora18 and SWIG > > Version 2.0.8. > > Which version of gnucash are you using? If I'm not mistaken the F18 gnucash is > still 2.4, ri

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread Felix Schwarz
Am 17.03.2014 11:21, schrieb Mike Evans: > new_book_with_opening_balances.py works for me too on Fedora18 and SWIG > Version 2.0.8. Which version of gnucash are you using? If I'm not mistaken the F18 gnucash is still 2.4, right? Felix ___ gnucash-deve

Re: Python bindings: Account.getName() raises TypeError

2014-03-17 Thread Mike Evans
On Sun, 16 Mar 2014 13:41:42 -0700 David Osguthorpe wrote: > On Sun, Mar 16, 2014 at 08:54:10PM +0100, Felix Schwarz wrote: > > > > Am 16.03.2014 20:38, schrieb John Ralls: > > > The signature of xaccAccountGetName is const char* xaccAccountGetName > > > (const Account *); the const was added i

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread David Osguthorpe
On Sun, Mar 16, 2014 at 11:04:59PM +0100, Felix Schwarz wrote: > > > > but then theres another error > > Actually your change resolves the problem for me :-) OK - yes - I think my error came because the existing book I used did not have any of the default accounts defined > > On a second run I

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread Felix Schwarz
Am 16.03.2014 21:55, schrieb David Osguthorpe: > this is one solution - which relates to the change between 2.4/2.6 > and get_children() > > for child in original_parent_account.get_children(): > #original_account = Account(instance=child) > original_account = child > > but th

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread David Osguthorpe
this is one solution - which relates to the change between 2.4/2.6 and get_children() for child in original_parent_account.get_children(): #original_account = Account(instance=child) original_account = child but then theres another error (note the new way is the way it shoul

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread David Osguthorpe
On Sun, Mar 16, 2014 at 08:54:10PM +0100, Felix Schwarz wrote: > > Am 16.03.2014 20:38, schrieb John Ralls: > > The signature of xaccAccountGetName is const char* xaccAccountGetName > > (const Account *); the const was added in 2005. A "const Account *" is not > > the same as an "Account const *

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread David Osguthorpe
as I never used swig > before): > TypeError: in method 'xaccAccountGetName', argument 1 of type 'Account const > *' between 2.4 and 2.6 there were a number of changes to the python bindings - plus a number of raw gnucash functions changed arguments so the bindings also

Re: Python bindings: Account.getName() raises TypeError

2014-03-16 Thread Felix Schwarz
Am 16.03.2014 20:38, schrieb John Ralls: > The signature of xaccAccountGetName is const char* xaccAccountGetName (const > Account *); the const was added in 2005. A "const Account *" is not the same > as an "Account const *": The former means that the contents of the pointer > won't change, the

  1   2   3   4   >