Questions about Python bindings

Daniele Varrazzo daniele.varrazzo at gmail.com
Mon Aug 2 13:31:46 EDT 2010


Hello,

I'm writing a few tools to generate GnuCash transactions from our
database and I'm using the Python bindings to script GnuCash.

I have an issue with the transactions creation: if I add splits to the
transaction before setting the currency I get a few warnings:

  * 18:04:09  CRIT <gnc.engine> [xaccTransScrubSplits()] Transaction
doesn't have a currency!
  * 18:04:09  CRIT <gnc.engine.scrub>
[xaccScrubUtilityGetOrMakeAccount()] No currency specified!
  * 18:04:09  CRIT <gnc.engine.scrub> [get_balance_split()] Can't get
balancing account

and an empty "imbalance-CCY" account is created. OTOH, if i set the
currency (or the description) on the transaction, the process
segfaults

  * 18:10:07  WARN <GLib-GObject> instance of invalid
non-instantiatable type `<invalid>'
  Segmentation fault

I suspect the problem is known as the scripts in the examples
directory are careful in setting the transaction details after the
first split - I can live whit that once I know the problem.

Is there a way to avoid the creation of the imbalance accounts too?

In the next days I may have more questions about the python bindings,
and hopefully some patches to provide back. Is this the best ML to
talk about the argument or there is something more specific?

Thank you very much.

-- Daniele


More information about the gnucash-devel mailing list