gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Apr 20 15:56:39 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/fc0a7292 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2745b18d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ba8a9c84 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/efbdab6f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/480aa4a5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/23948485 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4868e046 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ecab7968 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e2fd2418 (commit)
	from  https://github.com/Gnucash/gnucash/commit/aa53c232 (commit)



commit fc0a729253b0ddfa3c08b0282cae84222bd93dec
Merge: 2745b18d3 ba8a9c847
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Apr 20 12:55:41 2019 -0700

    Merge Christoph Holtermann's 'PR-python-bindings-update-source-doc' into maint


commit 2745b18d3b76eaec15639d35549c720730511dc3
Merge: aa53c2323 efbdab6f4
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Apr 20 12:47:12 2019 -0700

    Merge Christoph Holtermann's 'PR-dont-close-gnucash-on-pycons-close' into maint.


commit ba8a9c847883696b559868d4a6ff2a383145e193
Author: c-holtermann <mail at c-holtermann.net>
Date:   Sat Apr 20 15:10:41 2019 +0200

    update python source doc

diff --git a/libgnucash/doc/python-bindings-doxygen.py b/libgnucash/doc/python-bindings-doxygen.py
index c1a4f7b7a..78118a9e1 100644
--- a/libgnucash/doc/python-bindings-doxygen.py
+++ b/libgnucash/doc/python-bindings-doxygen.py
@@ -27,14 +27,14 @@
 ##  @page python_bindings_page Python bindings
 #   Also have a look at group @ref python_bindings.
 #
-#   They can be found in src/optional/python-bindings.
+#   In the source tree they are located at bindings/python.
 #
-#   To enable them in the compilation process you have to add --enable-python-bindings
-#   to the call of ./configure.
+#   To enable them in the compilation process you have to add  -DWITH_PYTHON=ON
+#   to the call of cmake.
 #
 #   As a starting point have a look at the \link python_bindings_examples example-scripts\endlink.
 #
-#   @section possibilities What are the Python bindings good for ?
+#   @section possibilities What can Python Bindings be used for ?
 #
 #   The python bindings supply the ability to access a wide range of the core functions of GnuCash. You
 #   can read and write Transactions, Commodities, Lots, access the business stuff... You gain the ability
@@ -43,6 +43,9 @@
 #   Not everything GnuCash can is possible to access though. The bindings focus on basic accounting functions.
 #   Have a look at the examples to get an impression.
 #
+#   Some functions are broken because they have not been wrapped properly. They may crash the program or return unaccessible values. 
+#   Please file a bug report if you find one to help support the development process.
+#
 #   @section python_bindings_section Principles
 #   The python-bindings are generated using SWIG from parts of the source-files of GnuCash.
 #
@@ -128,5 +131,5 @@
 #   @li There is a page in the GnuCash wiki at http://wiki.gnucash.org/wiki/Python
 #   @li You may also have a look into the archives of gnucash-devel at gnucash.org. 
 #   @li On Bugzilla there is also some interesting talk regarding the development process. 
-#   @li Then you can use the abilities of svn to see the history of the code by @code svn log @endcode done in the directory of the python-bindings.
+#   @li Then you can use the abilities of git to see the history of the code by @code git log @endcode done in the directory of the python-bindings.
 #

commit efbdab6f4de3f170f60a6b1149a12bcb898dccd8
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:57:00 2019 +0200

    don't kill main process on closing of shell

diff --git a/gnucash/python/pycons/console.py b/gnucash/python/pycons/console.py
index ce0b8aec9..d12f75392 100644
--- a/gnucash/python/pycons/console.py
+++ b/gnucash/python/pycons/console.py
@@ -434,7 +434,6 @@ class Console (Gtk.ScrolledWindow):
     def quit(self):
         """ Quit console """
 
-        # Gtk.main_quit()
         self.history_save()
         try:
             os.close (self.piperead)

commit 480aa4a57532bc4703903d0ad339d81a2542d4ce
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:55:49 2019 +0200

    connect console quit event handler to window destroy-event and delete-event

diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index e54c6569d..74094e53f 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -102,10 +102,8 @@ if False:
     window.set_position(Gtk.WindowPosition.CENTER)
     window.set_default_size(800,600)
     window.set_border_width(0)
-    # Hm. Gtk.main_quit will kill gnucash without closing the file
-    # properly. That's kinda bad.
-    # window.connect('destroy-event', Gtk.main_quit)
-    # window.connect('delete-event', Gtk.main_quit)
+    window.connect('destroy-event', console.quit_event)
+    window.connect('delete-event', console.quit_event)
     window.add (console)
     window.show_all()
     console.grab_focus()

commit 239484854c1b55af2f72f710d845f41734eb0367
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:55:07 2019 +0200

    add quit method to python console

diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index 8ea6360c8..e54c6569d 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -86,6 +86,12 @@ class Console (cons.Console):
             canvas.draw()
         return False
 
+    def quit (self):
+        """ quit """
+
+        self.write("\nHave a nice day !\n")
+        return super(Console, self).quit()
+
 
 # Change this to "if True:" to switch on a python console at gnucash
 # startup:

commit 4868e046c37a42c9ebf2bc9bed6820dbc11f33b0
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:54:44 2019 +0200

    add quit event handler to python console

diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index 5b8f2791d..8ea6360c8 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -75,6 +75,10 @@ class Console (cons.Console):
         """ Button press event """
         return self.refresh()
 
+    def quit_event (self, widget, event):
+        """ Event handler for closing of console window """
+        return self.quit()
+    
     def refresh (self):
         """ Refresh drawing """
         for fig in self.figures:

commit ecab7968e27e256031daab12876c58408bba7951
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:20:39 2019 +0200

    on quitting don't kill gtk main process

diff --git a/gnucash/python/pycons/console.py b/gnucash/python/pycons/console.py
index 411dcdc05..ce0b8aec9 100644
--- a/gnucash/python/pycons/console.py
+++ b/gnucash/python/pycons/console.py
@@ -434,7 +434,7 @@ class Console (Gtk.ScrolledWindow):
     def quit(self):
         """ Quit console """
 
-        Gtk.main_quit()
+        # Gtk.main_quit()
         self.history_save()
         try:
             os.close (self.piperead)

commit e2fd241836682cec0c6fb7f1052f91f5a26ada63
Author: c-holtermann <mail at c-holtermann.net>
Date:   Fri Apr 19 11:14:47 2019 +0200

    stop closing shell window from closing gnucash

diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index ca96f1223..5b8f2791d 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -94,8 +94,8 @@ if False:
     window.set_border_width(0)
     # Hm. Gtk.main_quit will kill gnucash without closing the file
     # properly. That's kinda bad.
-    window.connect('destroy-event', Gtk.main_quit)
-    window.connect('delete-event', Gtk.main_quit)
+    # window.connect('destroy-event', Gtk.main_quit)
+    # window.connect('delete-event', Gtk.main_quit)
     window.add (console)
     window.show_all()
     console.grab_focus()



Summary of changes:
 gnucash/python/init.py                    | 16 ++++++++++++----
 gnucash/python/pycons/console.py          |  1 -
 libgnucash/doc/python-bindings-doxygen.py | 13 ++++++++-----
 3 files changed, 20 insertions(+), 10 deletions(-)



More information about the gnucash-changes mailing list