John Ralls
939a77407c
Merge branch 'price-quotes-cpp'
3 years ago
Geert Janssens
e97fc3e408
Drop price-quotes.scm, gnc-fq-helper.in and gnc-fq-check.in - no longer used
3 years ago
John Ralls
a6e2842ea0
More distcheck fixes.
3 years ago
Christopher Lam
161b07b241
Merge branch 'maint'
4 years ago
luz paz
ba94730a23
Fix various typos
...
Found via `codespell`
4 years ago
Christopher Lam
0b5a4cd298
Merge branch 'maint'
4 years ago
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.
4 years ago
Christopher Lam
f1adb5da34
Merge branch 'TXN_TYPE-is-dynamic' xaccTransGetTxnType into maint #1201
4 years ago
Christopher Lam
fd12d3900c
[Transaction.c] use heuristics to determine txn->txn_type
4 years ago
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.
4 years ago
John Ralls
426b30c37e
Fix python tests dependencies
...
So that ninja check works from a clean build directory with Python enabled.
4 years ago
John Ralls
7d94ade599
[python]Remove non-namespace "All non-currency" fom namespace test.
4 years ago
Christoph Holtermann
6a015c8744
make GncNumeric.invert() return GncNumeric
4 years ago
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.
4 years ago
John Ralls
cbfacdcd55
Merge Christoff Holtermann's 'python-qof-example' into maint.
4 years ago
John Ralls
d841b322d0
Merge Frank Ellenberger's 'Bug684507' into maint.
4 years ago
Christoph Holtermann
64920e7c70
Small fix in expected result
4 years ago
Christoph Holtermann
07cfe9e45c
Missed one redundancy
4 years ago
Christoph Holtermann
395c7a7052
Modify examples to respect previous patch
4 years ago
Christoph Holtermann
62f8acf6ae
Provide the complete set of QOF enums in gnucash
4 years ago
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.
4 years ago
Christoph Holtermann
f44d23035e
python qof examples
4 years ago
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.
4 years ago
Frank H. Ellenberger
c7f842c081
Bug 684507 - commodity namespace should be localized
4 years ago
John Ralls
b8552a8070
Fix python transaction test_date on Ubuntu-81.04.
...
Python3 there is too old for fromisoformat, use direct construction
instead.
5 years ago
John Ralls
fcab298245
Add test for Transaction GetDate() in python bindings.
...
Pursuant to Bug 798284.
5 years ago
Steven Walter
5f721614ad
Remove unneeded .decode() from Invoice*.tex.templ
...
These values are already str's, don't decode them
5 years ago
Steven Walter
3ed6b4dab9
latex_invoices.py: write takes string not bytes
...
write() fails if you give it bytes, so don't encode
5 years ago
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)
5 years ago
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.
5 years ago
luz paz
95f8884892
Fix misc. typos in comments
5 years ago
Hong Xu
79d5270c9d
Fix a variable name typo in Python binding gnc_pricedb_lookup_latest_before_t64
...
commodit -> commodity
5 years ago
John Ralls
49102c7ac2
Python Bindings: Provide a deprecated GncPriceDB.lookup_latest_before_t64.
...
To avoid breaking user scripts.
5 years ago
Robert Fewell
87285f945e
Update gnucash_core.py with gnc-pricedb function name change
5 years ago
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')
5 years ago
c-holtermann
d3b8a59d7e
remove debug information for time conversion
5 years ago
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.
5 years ago
John Ralls
66eca8aab7
Update python/gnucash_business.py to reflect rename of gncOwnerApplyPayment.
...
Made 3 years ago.
5 years ago
Hong Xu
e0e77ca39d
Add Python example export_account_totals.py
...
This example exports acount totals of all accounts into a CSV file.
This has been asked before: https://money.stackexchange.com/questions/111786/exporting-account-totals-in-gnucash
6 years ago
c-holtermann
22f91c407e
use same order in comment as in definition of SessionOpenMode enum
6 years ago
c-holtermann
40cfb70fb7
fix SessionOpenMode explanation for SESSION_NORMAL_OPEN
6 years ago
c-holtermann
3e842a7bf6
use urllib.parse.urlparse to check for xml on python Session init
6 years ago
c-holtermann
b9c6fc2876
add some unittests for python Session
...
test arguments, deprecated as well as new mode arguments
test creating a session with a new xml file using __init__()
and begin(). Test raising exception when opening nonexistent
file without respective mode setting.
6 years ago
c-holtermann
0434acbe10
reformat two python example scripts with black
...
use black python code formatter on latex_invoices.py and gncinvoice_jinja.py
6 years ago
c-holtermann
485d8a65b0
decorate Session.begin with default mode argument
6 years ago
c-holtermann
44e61f4df2
enable Session.__init__() to be provided with existing instance or book
6 years ago
c-holtermann
5833c5afcb
add unittests for function_class
...
add tests for some existing function_class functionality.
Add tests for the keyword argument changes.
6 years ago
c-holtermann
17d606e1f8
enable keyword arguments for default_arguments_decorator
...
default_arguments_decorator until now only allows positional
argument defaults. This adds keyword defaults. The keywords
can be mapped to the positional arguments by optional argument
kargs_pos so interactions between keyword and positional arg
defaults can raise a TypeError. Some more information in
the docstring is included. In addition the docstring of
the wrapped function will be modified to contain information
about the defaults.
6 years ago
c-holtermann
c222503f42
add method decorate_method to function_class.py
...
ClassFromFunctions.decorate_method() allows to provide positional
and keyword arguments for the decorator call besides the wrapped
method.
6 years ago
c-holtermann
ee77b713c2
update example scripts to SessionOpenMode
6 years ago