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
On Sun, Mar 16, 2014 at 08:08:44PM +0100, Felix Schwarz wrote: > Hey, > > after switching to gnucash 2.6 I noticed that at least some of the Python > methods are broken [1]. A call to Account.getName() raises a TypeError but > unfortunately the error message is not helpful to me (as I never used s

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

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

2014-03-16 Thread John Ralls
On Mar 16, 2014, at 12:08 PM, Felix Schwarz wrote: > Hey, > > after switching to gnucash 2.6 I noticed that at least some of the Python > methods are broken [1]. A call to Account.getName() raises a TypeError but > unfortunately the error message is not helpful to me (as I never used swig > be