mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-30 12:44:01 -06:00
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
This commit is contained in:
parent
150c3dae48
commit
1b26fa2bcb
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user