gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Apr 25 17:11:32 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/d7a2fa72 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0553576c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4140569a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f6cb8031 (commit)
	from  https://github.com/Gnucash/gnucash/commit/8f5094f9 (commit)



commit d7a2fa72e7c5c90ad0f583a9df8124bbae5fa803
Merge: 8f5094f99 0553576c8
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Apr 25 13:43:54 2020 -0700

    Merge Christoph Holtermann's 'python-app-utils-2' into maint.
    
    https://github.com/Gnucash/gnucash/pull/701


commit 0553576c818758d2af6560bafc80dc3dace17c9c
Author: c-holtermann <mail at c-holtermann.net>
Date:   Mon Apr 20 16:03:27 2020 +0200

    restructure info so that python help will display it

diff --git a/bindings/python/app_utils.py b/bindings/python/app_utils.py
index 82d809ce6..7af679911 100644
--- a/bindings/python/app_utils.py
+++ b/bindings/python/app_utils.py
@@ -4,13 +4,14 @@
 ## @file
 #  @brief High level python wrapper for app-utils
 #  @ingroup python_bindings 
+#
+# further functions in _sw_app_utils that have not been included:
+# _gnc_get_current_book is available through Session.get_book()
+# _gnc_get_current_root_account is available through Book.get_root_account()
+
 
 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()

commit 4140569ac080015add843d522a2131e91a1afd53
Author: c-holtermann <mail at c-holtermann.net>
Date:   Mon Apr 20 15:58:42 2020 +0200

    utilize app_utils wrapper

diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index bd8e383dd..6dabdc6ce 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -1,5 +1,4 @@
 import sys
-import gnucash._sw_app_utils as _sw_app_utils
 from gnucash import *
 from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled, gnc_prefs_is_debugging_enabled
 from gi import require_version
@@ -23,9 +22,9 @@ signal.signal(signal.SIGTTOU, old_sigttou)
 if gnc_prefs_is_extra_enabled() and gnc_prefs_is_debugging_enabled():
     print("Hello from python!")
     print("test", sys.modules.keys())
-    print("test2", dir(_sw_app_utils))
 
-   #root = _sw_app_utils.gnc_get_current_root_account()
+    #session = app_utils.gnc_get_current_session()
+    #root account can later on be accessed by session.get_book().get_root_account()
 
    #print("test", dir(root), root.__class__)
     print("test3", dir(gnucash_core_c))

commit f6cb8031928972dde155ab7fd3b9816817b829ef
Author: c-holtermann <mail at c-holtermann.net>
Date:   Mon Apr 20 15:23:14 2020 +0200

    app_utils needs to be imported to module gnucash to be accessible

diff --git a/bindings/python/__init__.py b/bindings/python/__init__.py
index 1c874734e..16b72fba9 100644
--- a/bindings/python/__init__.py
+++ b/bindings/python/__init__.py
@@ -4,6 +4,7 @@
 # instead of
 # >>> from gnucash.gnucash_core import thingy
 from gnucash.gnucash_core import *
+from . import app_utils
 ##  @file
 #   @brief helper file for the importing of gnucash
 #   @author Mark Jenkins, ParIT Worker Co-operative <mark at parit.ca>



Summary of changes:
 bindings/python/__init__.py  | 1 +
 bindings/python/app_utils.py | 9 +++++----
 gnucash/python/init.py       | 5 ++---
 3 files changed, 8 insertions(+), 7 deletions(-)



More information about the gnucash-changes mailing list