Commit Graph

205 Commits

Author SHA1 Message Date
Geert Janssens
e8d72ad53f Doxygen - merge separate txt files into respective header files 2024-05-23 15:10:05 +02:00
John Ralls
a3f14759ab Asan: Make leak and ODR violation reporting CMake options.
pass -DLEAKS=ON or -DODR=ON to enable these features. They have an
effect only with CMAKE_BUILD_TYPE=Asan and don't work on Apple because
Apple clang doesn't enable them.
2023-11-25 11:17:14 -08:00
John Ralls
2234fa433e Add Asan build type that enables the Address and UB sanitizers.
Uses generator statements instead of CMAKE_<TYPE>_FLAGS_ASAN to support multiconfig generators like Xcode.
2023-11-02 12:58:46 -07:00
John Ralls
17ebb8a1d2 [simple-business-create.py] Overwrite an existing file instead of crashing. 2023-09-11 17:39:02 -07:00
Christopher Lam
7ce4198c20 rename string_to_gnc_numeric to gnc_numeric_from_string 2023-08-29 08:45:20 +08:00
Geert Janssens
29b7a9099d Fix cmake warnings while searching for python
There is a new find module since cmake 3.12. Cmake 3.27 will start
emitting warnings if the old modules are still in use.

Current implementation supports both. As soon as we can bump our minimal
cmake version to 3.12, the old support code can be dropped as well.
2023-08-17 18:23:33 +02:00
Richard Cohen
e43982375c Valgrind: fix "definitely lost" memory in test - sqlite3test
==64824== 171 (88 direct, 83 indirect) bytes in 1 blocks are definitely lost in loss record 392 of 418
==64824==    at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==64824==    by 0x528A935: qof_session_new (qofsession.cpp:148)
==64824==    by 0x141832: main (sqlite3test.c:34)
2023-07-19 10:21:30 +01:00
Richard Cohen
27fe72496e Remove unused ${GLIB_LIBS} ${GLIB_INCLUDE_DIRS}
They have been replaced by GLIB2_*
2023-02-21 12:50:38 +00:00
Richard Cohen
56d950598d [-Wunused-variable] - pretend to use
Looks like a SWIG bug, creating an extra variable that it doesn't use

bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcileLastDate’:
bindings/python/gnucash_core.c:10096:10: warning: unused variable ‘secs20’ [-Wunused-variable]
10096 |   time64 secs20 ;
      |          ^~~~~~
bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcilePostponeDate’:
bindings/python/gnucash_core.c:10298:10: warning: unused variable ‘secs20’ [-Wunused-variable]
10298 |   time64 secs20 ;
      |          ^~~~~~
bindings/python/gnucash_core.c: In function ‘_wrap_qof_query_date_predicate_get_date’:
bindings/python/gnucash_core.c:20237:10: warning: unused variable ‘secs20’ [-Wunused-variable]
20237 |   time64 secs20 ;
      |          ^~~~~~
2023-02-16 09:20:59 +00:00
John Ralls
732a005710 Merge Christoph Holtermann's 'python-log-access' into master. 2023-02-06 15:24:04 -08:00
Christopher Lam
119356752f Merge branch 'maint' 2023-01-30 09:56:13 +08:00
luzpaz
67ab9e90d2 Fix some typos 2023-01-26 13:48:58 +01:00
John Ralls
939a77407c Merge branch 'price-quotes-cpp' 2022-10-14 11:25:14 -07:00
Geert Janssens
e97fc3e408 Drop price-quotes.scm, gnc-fq-helper.in and gnc-fq-check.in - no longer used 2022-10-02 11:50:26 -07:00
John Ralls
a6e2842ea0 More distcheck fixes. 2022-10-02 09:47:35 -07:00
Christopher Lam
161b07b241 Merge branch 'maint' 2022-09-09 21:23:40 +08:00
luz paz
ba94730a23 Fix various typos
Found via `codespell`
2022-09-06 10:44:29 -04:00
Christopher Lam
0b5a4cd298 Merge branch 'maint' 2022-08-03 20:38:08 +08:00
John Ralls
688832b5f8 Bug 798585 - segfault running sample script
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.

So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
2022-07-30 16:50:51 -07:00
Christopher Lam
f1adb5da34 Merge branch 'TXN_TYPE-is-dynamic' xaccTransGetTxnType into maint #1201 2022-07-18 09:24:32 +08:00
Christopher Lam
fd12d3900c [Transaction.c] use heuristics to determine txn->txn_type 2022-07-18 09:24:05 +08:00
John Ralls
f4c27d4494 Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c
To prevent a circular dependency between libgnc-app-utils and
libgnucash-guile.
2022-07-17 10:00:23 -07:00
John Ralls
426b30c37e Fix python tests dependencies
So that ninja check works from a clean build directory with Python enabled.
2022-07-16 16:36:46 -07:00
John Ralls
7d94ade599 [python]Remove non-namespace "All non-currency" fom namespace test. 2022-03-25 15:19:57 -07:00
Christoph Holtermann
6a015c8744 make GncNumeric.invert() return GncNumeric 2022-03-20 20:04:56 +01:00
Christoph Holtermann
567df27cc7 Implement some comparisons and arithmetics for GncNumeric
Derive some numeric comparisons and arithmetics from Fraction
class
https://github.com/python/cpython/blob/3.7/Lib/fractions.py
and general information from
https://docs.python.org/3/library/numbers.html#numbers.Integral

These methods are bound closer to the gnucash-C-api than those
from the fraction class.

This is not the full set of comparisons and arithmetics, needs
to be extended. It would be good to extend tests to cover this.
2022-03-20 20:04:44 +01:00
John Ralls
cbfacdcd55 Merge Christoff Holtermann's 'python-qof-example' into maint. 2022-03-08 13:46:07 -08:00
John Ralls
d841b322d0 Merge Frank Ellenberger's 'Bug684507' into maint. 2022-03-08 12:39:47 -08:00
Christoph Holtermann
64920e7c70 Small fix in expected result 2022-03-08 10:49:44 +01:00
Christoph Holtermann
07cfe9e45c Missed one redundancy 2022-03-08 10:45:17 +01:00
Christoph Holtermann
395c7a7052 Modify examples to respect previous patch 2022-03-08 10:40:12 +01:00
Christoph Holtermann
62f8acf6ae Provide the complete set of QOF enums in gnucash 2022-03-08 10:33:25 +01:00
Christoph Holtermann
06e17dfd5c Provide wrapper for qof numeric predicate
Python bindings already have some wrapping objects for
qof predicates. This adds the one missing for GncNumeric
comparisons.

Additionally fixes a wrong number for QOF_NUMERIC_MATCH_ANY
in example file.
2022-03-08 09:45:48 +01:00
Christoph Holtermann
f44d23035e python qof examples 2022-03-06 23:52:32 +01:00
John Ralls
9ad24321b4 Remove investment-type namespaces.
Leave it to users to categorize their non-currency commodities. In the
QIF importer default non-classifiable commodities to
GNC_COMMODITY_NS_NONCURRENCY.
2022-03-01 19:58:23 -08:00
Frank H. Ellenberger
c7f842c081 Bug 684507 - commodity namespace should be localized 2022-03-01 19:58:11 -08:00
John Ralls
b8552a8070 Fix python transaction test_date on Ubuntu-81.04.
Python3 there is too old for fromisoformat, use direct construction
instead.
2021-09-10 17:01:38 -07:00
John Ralls
fcab298245 Add test for Transaction GetDate() in python bindings.
Pursuant to Bug 798284.
2021-09-10 13:26:59 -07:00
Steven Walter
5f721614ad Remove unneeded .decode() from Invoice*.tex.templ
These values are already str's, don't decode them
2021-08-03 15:59:54 -04:00
Steven Walter
3ed6b4dab9 latex_invoices.py: write takes string not bytes
write() fails if you give it bytes, so don't encode
2021-08-01 22:17:41 -04:00
Steven Walter
ba4852a9da latex_invoices.py: use default locale
Don't hardcode a locale.  Empty string means to use the user's locale
(e.g. $LANG)
2021-08-01 22:17:11 -04:00
Steven Walter
ad3895fa07 latex_invoices.py: don't decode() a str
These functions all return str's not bytes.  Therefore there is no need
to decode them.
2021-08-01 22:16:33 -04:00
luz paz
95f8884892 Fix misc. typos in comments 2021-06-29 08:46:34 +02:00
Hong Xu
79d5270c9d Fix a variable name typo in Python binding gnc_pricedb_lookup_latest_before_t64
commodit -> commodity
2021-06-13 01:12:59 -07:00
John Ralls
49102c7ac2 Python Bindings: Provide a deprecated GncPriceDB.lookup_latest_before_t64.
To avoid breaking user scripts.
2021-04-23 11:56:15 +01:00
Robert Fewell
87285f945e Update gnucash_core.py with gnc-pricedb function name change 2021-04-23 11:56:15 +01:00
koldavi
506fd57989
Fix to_string_with_decimal_point_placed
>>> nominator='123456'
A digit is missing in the string returned from to_string_with_decimal_point_placed. The -1 error.
>>> point_place=2
>>> nominator[:-point_place - 1], nominator[-point_place:]
('123', '56')
2021-04-01 13:26:15 +02:00
c-holtermann
d3b8a59d7e remove debug information for time conversion 2021-03-27 14:05:21 +01:00
John Ralls
a11065b823 Fix fencepost error in calculating the week_num for POSIX timezone rules.
Fixes CI failure caused by US starting DST in 2021, a year in which
March began on a Monday.
2021-03-15 17:07:16 -07:00
John Ralls
66eca8aab7 Update python/gnucash_business.py to reflect rename of gncOwnerApplyPayment.
Made 3 years ago.
2021-03-14 10:48:30 -07:00