gnucash unstable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Nov 28 20:09:58 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/c6ae007b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/744cdac5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c9c58764 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e011576e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1ef379a7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/5aa048e0 (commit)



commit c6ae007bda0e3a4b3eaeb3e55193b150f6472461
Merge: 5aa048e 744cdac
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Nov 28 17:09:38 2017 -0800

    Merge branch 'PyGncNumeric' into unstable

commit 744cdac5a4dfb3e62f5d447d4f71be872f182c88
Author: Guy Taylor <thebigguy.co.uk at gmail.com>
Date:   Sat Jun 3 17:51:54 2017 +0100

    Use builtin SWIG conversions for glib types
    
    Where possible in the Python SWIG code use the builtin SWIG conversion
    code over custom code. This ensures appropriate overflow/type checking.
    With this I have enabled GncNumeric from longs and tested for correct
    overflow handling.
    
    Note: This could be extended to GUILE but I am not familiar enought to
    safely enable this.

commit c9c58764318ab7e82ac21958326a64a27f6d409a
Author: Guy Taylor <thebigguy.co.uk at gmail.com>
Date:   Sat Jun 3 16:06:09 2017 +0100

    Use glib.h over custom typedefs in Python SWIG
    
    Use the native glib.h (mainly gint, gfloat ...) over custom typedefs in
    SWIG type files. This is for Python only.

commit e011576e37e25c2876c6ed8578a8ccc2573573f1
Author: Guy Taylor <thebigguy.co.uk at gmail.com>
Date:   Sun May 28 22:13:39 2017 +0100

    Add GncNumeric to native Python Fraction
    
    Add helper method to return the native Python fraction type from GncNumeric.

commit 1ef379a704e070a174eebb894487a230008d9977
Author: Guy Taylor <thebigguy.co.uk at gmail.com>
Date:   Wed May 17 11:37:20 2017 +0100

    Fix Python GncNumeric for non (int, int) pairs
    
    At current the Python GncNumeric has issues with type conversion eg.
     * GncNumeric(1.3) = 1.00
     * GncNumeric("1.3") is OK but any future methods error
    
    This behaviour was relied on for the Account tests to pass as it used
    GncNumeric(0.5) == GncNumeric(1.0) but this is not what many users would
    expect.
    
    This fix alows GncNumeric to be constructed from a (int, int)
    numerator/denominator pair or int/float/str where double_to_gnc_numeric
    and string_to_gnc_numeric from C is used.



Summary of changes:
 bindings/python/gnucash_core.py              |  70 +++++++++++++-----
 bindings/python/tests/CMakeLists.txt         |   1 +
 bindings/python/tests/Makefile.am            |   2 +
 bindings/python/tests/runTests.py.in         |   3 +-
 bindings/python/tests/test_account.py        |   4 +-
 bindings/python/tests/test_numeric.py        | 106 +++++++++++++++++++++++++++
 common/base-typemaps.i                       |  41 ++++-------
 common/cmake_modules/GncAddSwigCommand.cmake |  23 ++++--
 common/test-core/Makefile.am                 |   2 +-
 libgnucash/app-utils/Makefile.am             |   2 +-
 libgnucash/core-utils/Makefile.am            |   2 +-
 11 files changed, 201 insertions(+), 55 deletions(-)
 create mode 100644 bindings/python/tests/test_numeric.py



More information about the gnucash-patches mailing list