mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge Christoph Holtermann's 'python-app-utils' into maint.
This commit is contained in:
commit
882fd22ca1
@ -1,7 +1,7 @@
|
|||||||
add_subdirectory(example_scripts)
|
add_subdirectory(example_scripts)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
set(PYEXEC_FILES __init__.py function_class.py gnucash_business.py gnucash_core.py)
|
set(PYEXEC_FILES __init__.py function_class.py gnucash_business.py gnucash_core.py app_utils.py)
|
||||||
|
|
||||||
set(SWIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/gnucash_core.i ${CMAKE_CURRENT_SOURCE_DIR}/time64.i)
|
set(SWIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/gnucash_core.i ${CMAKE_CURRENT_SOURCE_DIR}/time64.i)
|
||||||
set(GNUCASH_CORE_C_INCLUDES
|
set(GNUCASH_CORE_C_INCLUDES
|
||||||
|
16
bindings/python/app_utils.py
Normal file
16
bindings/python/app_utils.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# app_utils.py -- High level python wrapper for app-utils
|
||||||
|
#
|
||||||
|
# @author Christoph Holtermann <mail@c-holtermann.net>
|
||||||
|
## @file
|
||||||
|
# @brief High level python wrapper for app-utils
|
||||||
|
# @ingroup python_bindings
|
||||||
|
|
||||||
|
from gnucash import _sw_app_utils
|
||||||
|
|
||||||
|
def gnc_get_current_session():
|
||||||
|
from gnucash import Session
|
||||||
|
return Session(instance=_sw_app_utils.gnc_get_current_session())
|
||||||
|
|
||||||
|
# further functions in _sw_app_utils
|
||||||
|
# _gnc_get_current_book is availabe through Session.get_book()
|
||||||
|
# _gnc_get_current_root_account is available through Session.get_root_account()
|
Loading…
Reference in New Issue
Block a user