mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
enable Session.__init__() to be provided with existing instance or book
This commit is contained in:
@@ -210,7 +210,12 @@ class Session(GnuCashCoreClass):
|
||||
you don't need to cleanup and call end() and destroy(), that is handled
|
||||
for you, and the exception is raised.
|
||||
"""
|
||||
GnuCashCoreClass.__init__(self, Book())
|
||||
if instance is not None:
|
||||
GnuCashCoreClass.__init__(self, instance=instance)
|
||||
else:
|
||||
if book is None:
|
||||
book = Book()
|
||||
GnuCashCoreClass.__init__(self, book)
|
||||
|
||||
if book_uri is not None:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user