Skip to content

Commit

Permalink
high level python wrappers for app-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
c-holtermann committed Apr 6, 2020
1 parent 0d0fddc commit e2c3735
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/python/CMakeLists.txt
@@ -1,7 +1,7 @@
add_subdirectory(example_scripts)
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(GNUCASH_CORE_C_INCLUDES
Expand Down
16 changes: 16 additions & 0 deletions bindings/python/app_utils.py
@@ -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()

0 comments on commit e2c3735

Please sign in to comment.