gnucash maint: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Mon Dec 24 16:56:20 EST 2018
Updated via https://github.com/Gnucash/gnucash/commit/b8574a00 (commit)
via https://github.com/Gnucash/gnucash/commit/ff660a87 (commit)
via https://github.com/Gnucash/gnucash/commit/8fe0b142 (commit)
via https://github.com/Gnucash/gnucash/commit/b431d471 (commit)
via https://github.com/Gnucash/gnucash/commit/929a3bcd (commit)
from https://github.com/Gnucash/gnucash/commit/d97508d0 (commit)
commit b8574a004ac32747bda5bd3dee9da842fb557074
Merge: d97508d ff660a8
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Dec 24 13:53:22 2018 -0800
Merge Christoff Holterman's 'PR-Python-GetBalTaxValues' into maint.
commit ff660a873e4738a3b694dd64cfc949573d90a20f
Author: Christoph Holtermann <c.holtermann at gmx.de>
Date: Tue Dec 4 12:17:56 2018 +0100
Revert "Question about GncMonetary class instead of tuple"
This reverts commit 8fe0b14213a81419ee6808b270773ebd46fb6844.
Question has been discussed in pull request.
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index 05306ca..b268503 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -445,8 +445,7 @@ def decorate_monetary_list_returning_function(orig_function):
array of tuples: (GncCommodity, GncNumeric)
ToDo:
- * Maybe this function should better reside in module function_class ?
- * Should it be tuples anyway ? Wouldn't it be better to have GncMonetary to reflect gnc_monetary in c ?"""
+ Maybe this function should better reside in module function_class (?)"""
# warning, item.commodity has been shown to be None
# when the transaction doesn't have a currency
return [(GncCommodity(instance=item.commodity),
commit 8fe0b14213a81419ee6808b270773ebd46fb6844
Author: Christoph Holtermann <c.holtermann at gmx.de>
Date: Sun Nov 11 18:58:46 2018 +0100
Question about GncMonetary class instead of tuple
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index b268503..05306ca 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -445,7 +445,8 @@ def decorate_monetary_list_returning_function(orig_function):
array of tuples: (GncCommodity, GncNumeric)
ToDo:
- Maybe this function should better reside in module function_class (?)"""
+ * Maybe this function should better reside in module function_class ?
+ * Should it be tuples anyway ? Wouldn't it be better to have GncMonetary to reflect gnc_monetary in c ?"""
# warning, item.commodity has been shown to be None
# when the transaction doesn't have a currency
return [(GncCommodity(instance=item.commodity),
commit b431d471e0af0484642a2e97079499a1591c6e16
Author: Christoph Holtermann <c.holtermann at gmx.de>
Date: Sun Nov 11 18:11:11 2018 +0100
decorate monetary list to access GncCommodity and GncNumeric
diff --git a/bindings/python/gnucash_business.py b/bindings/python/gnucash_business.py
index f2e47e6..53b8e1b 100644
--- a/bindings/python/gnucash_business.py
+++ b/bindings/python/gnucash_business.py
@@ -374,3 +374,6 @@ methods_return_instance(Entry, entry_dict)
Entry.decorate_functions(
decorate_to_return_instance_instead_of_owner,
'GetBillTo' )
+
+from gnucash.gnucash_core import decorate_monetary_list_returning_function
+Entry.decorate_functions(decorate_monetary_list_returning_function, 'GetBalTaxValues')
commit 929a3bcd9ec5704fc4998376ae827d0d6f7338a1
Author: Christoph Holtermann <c.holtermann at gmx.de>
Date: Sun Nov 11 18:12:32 2018 +0100
pass additional args and document function
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index c1863bd..b268503 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -435,12 +435,22 @@ class Transaction(GnuCashCoreClass):
gncInvoiceGetInvoiceFromTxn, Transaction )
def decorate_monetary_list_returning_function(orig_function):
- def new_function(self):
+ def new_function(self, *args):
+ """decorate function that returns list of gnc_monetary to return tuples of GncCommodity and GncNumeric
+
+ Args:
+ *args: Variable length argument list. Will get passed to orig_function
+
+ Returns:
+ array of tuples: (GncCommodity, GncNumeric)
+
+ ToDo:
+ Maybe this function should better reside in module function_class (?)"""
# warning, item.commodity has been shown to be None
# when the transaction doesn't have a currency
return [(GncCommodity(instance=item.commodity),
GncNumeric(instance=item.value))
- for item in orig_function(self) ]
+ for item in orig_function(self, *args) ]
return new_function
class Split(GnuCashCoreClass):
Summary of changes:
bindings/python/gnucash_business.py | 3 +++
bindings/python/gnucash_core.py | 14 ++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list