From 1b26fa2bcb931a7a7449bc913448db50a98307ab Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 16 Nov 2010 22:07:58 +0000 Subject: [PATCH] Fix python samples to work with reordered Session.__init__() args git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19819 57a11ea4-9604-0410-9ed3-97b8803252fd --- .../example_scripts/new_book_with_opening_balances.py | 4 ++-- .../python-bindings/example_scripts/simple_business_create.py | 2 +- .../python-bindings/example_scripts/simple_invoice_insert.py | 2 +- .../python-bindings/example_scripts/simple_session.py | 2 +- .../python-bindings/example_scripts/simple_sqlite_create.py | 2 +- src/optional/python-bindings/example_scripts/simple_test.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/optional/python-bindings/example_scripts/new_book_with_opening_balances.py b/src/optional/python-bindings/example_scripts/new_book_with_opening_balances.py index 6d71dec9d1..a5d5555ae7 100644 --- a/src/optional/python-bindings/example_scripts/new_book_with_opening_balances.py +++ b/src/optional/python-bindings/example_scripts/new_book_with_opening_balances.py @@ -262,8 +262,8 @@ def create_opening_balance_transaction(commodtable, namespace, mnemonic, return simple_opening_name_used def main(): - original_book_session = Session(argv[1], False) - new_book_session = Session(argv[2], True) + original_book_session = Session(argv[1], is_new=False) + new_book_session = Session(argv[2], in_new=True) new_book = new_book_session.get_book() new_book_root = new_book.get_root_account() diff --git a/src/optional/python-bindings/example_scripts/simple_business_create.py b/src/optional/python-bindings/example_scripts/simple_business_create.py index 78f46c38a2..dd36226749 100644 --- a/src/optional/python-bindings/example_scripts/simple_business_create.py +++ b/src/optional/python-bindings/example_scripts/simple_business_create.py @@ -46,7 +46,7 @@ from gnucash.gnucash_core_c import \ GNC_OWNER_CUSTOMER, ACCT_TYPE_LIABILITY -s = Session(argv[1], True) +s = Session(argv[1], is_new=True) # this seems to make a difference in more complex cases s.save() diff --git a/src/optional/python-bindings/example_scripts/simple_invoice_insert.py b/src/optional/python-bindings/example_scripts/simple_invoice_insert.py index db833c4eb0..2c9ce52d26 100644 --- a/src/optional/python-bindings/example_scripts/simple_invoice_insert.py +++ b/src/optional/python-bindings/example_scripts/simple_invoice_insert.py @@ -73,7 +73,7 @@ def gnc_numeric_from_decimal(decimal_value): return GncNumeric(numerator, denominator) -s = Session(argv[1], False) +s = Session(argv[1], is_new=False) # this seems to make a difference in more complex cases s.save() diff --git a/src/optional/python-bindings/example_scripts/simple_session.py b/src/optional/python-bindings/example_scripts/simple_session.py index ff4f70e0f0..82ad457919 100644 --- a/src/optional/python-bindings/example_scripts/simple_session.py +++ b/src/optional/python-bindings/example_scripts/simple_session.py @@ -16,7 +16,7 @@ except GnuCashBackendException, backend_exception: # create a new file -session = Session("xml://%s" % FILE_2, True) +session = Session("xml://%s" % FILE_2, is_new=True) session.save() session.end() session.destroy() diff --git a/src/optional/python-bindings/example_scripts/simple_sqlite_create.py b/src/optional/python-bindings/example_scripts/simple_sqlite_create.py index 5d522c2421..14759a4f2a 100644 --- a/src/optional/python-bindings/example_scripts/simple_sqlite_create.py +++ b/src/optional/python-bindings/example_scripts/simple_sqlite_create.py @@ -4,7 +4,7 @@ from gnucash import Session, Account from os.path import abspath from gnucash.gnucash_core_c import ACCT_TYPE_ASSET -s = Session('sqlite3://%s' % abspath('test.blob'), True) +s = Session('sqlite3://%s' % abspath('test.blob'), is_new=True) # this seems to make a difference in more complex cases s.save() diff --git a/src/optional/python-bindings/example_scripts/simple_test.py b/src/optional/python-bindings/example_scripts/simple_test.py index 47813a8a7f..a1c3e5ef70 100644 --- a/src/optional/python-bindings/example_scripts/simple_test.py +++ b/src/optional/python-bindings/example_scripts/simple_test.py @@ -5,7 +5,7 @@ from gnucash import Session, Account, Transaction, Split, GncNumeric FILE_1 = "/tmp/example.gnucash" -session = Session("xml://%s" % FILE_1, True) +session = Session("xml://%s" % FILE_1, is_new=True) book = session.book root_acct = Account(book)