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 stdin, line 1, in

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

2014-03-18 Thread Mike Evans
On Mon, 17 Mar 2014 10:32:17 + Mike Evans mi...@saxicola.idps.co.uk wrote: On Mon, 17 Mar 2014 11:26:30 +0100 Felix Schwarz felix.schw...@oss.schwarz.eu wrote: Am 17.03.2014 11:21, schrieb Mike Evans: new_book_with_opening_balances.py works for me too on Fedora18 and SWIG

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

2014-03-18 Thread Derek Atkins
John Ralls jra...@ceridwen.us writes: On Mar 17, 2014, at 10:52 AM, Derek Atkins warl...@mit.edu wrote: John Ralls jra...@ceridwen.us writes: TypeError: in method 'xaccAccountGetName', argument 1 of type Account const *' [snip] The signature of xaccAccountGetName is const char*

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

2014-03-18 Thread John Ralls
On Mar 18, 2014, at 6:30 AM, Derek Atkins warl...@mit.edu wrote: John Ralls jra...@ceridwen.us writes: On Mar 17, 2014, at 10:52 AM, Derek Atkins warl...@mit.edu wrote: John Ralls jra...@ceridwen.us writes: TypeError: in method 'xaccAccountGetName', argument 1 of type Account const *'

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

2014-03-17 Thread Mike Evans
On Sun, 16 Mar 2014 13:41:42 -0700 David Osguthorpe david.osgutho...@gmail.com 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

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-devel

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

2014-03-17 Thread Mike Evans
On Mon, 17 Mar 2014 11:26:30 +0100 Felix Schwarz felix.schw...@oss.schwarz.eu 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

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 david.osgutho...@gmail.com 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

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

2014-03-17 Thread Derek Atkins
John Ralls jra...@ceridwen.us 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

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

2014-03-17 Thread John Ralls
On Mar 17, 2014, at 10:52 AM, Derek Atkins warl...@mit.edu wrote: John Ralls jra...@ceridwen.us writes: TypeError: in method 'xaccAccountGetName', argument 1 of type Account const *' [snip] The signature of xaccAccountGetName is const char* xaccAccountGetName (const Account *); the

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

2014-03-16 Thread John Ralls
On Mar 16, 2014, at 12:08 PM, Felix Schwarz felix.schw...@oss.schwarz.eu 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

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 swig

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 *: The

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

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 then