update example scripts to SessionOpenMode

This commit is contained in:
c-holtermann
2020-06-12 12:24:05 +02:00
parent b073dbc5c3
commit ee77b713c2
11 changed files with 46 additions and 25 deletions

View File

@@ -46,7 +46,7 @@
# @author Mark Jenkins, ParIT Worker Co-operative <mark@parit.ca>
# @ingroup python_bindings_examples
from gnucash import Session, GUID, GncNumeric
from gnucash import Session, GUID, GncNumeric, SessionOpenMode
from gnucash.gnucash_business import Customer, Invoice, Entry
from gnucash.gnucash_core_c import string_to_guid
from os.path import abspath
@@ -86,7 +86,7 @@ def gnc_numeric_from_decimal(decimal_value):
return GncNumeric(numerator, denominator)
s = Session(argv[1], is_new=False)
s = Session(argv[1], SessionOpenMode.SESSION_NORMAL_OPEN)
book = s.book
root = book.get_root_account()