Commit Graph

53 Commits

Author SHA1 Message Date
John Ralls
d9ed847595 Merge Christoph Holterman's 'PR-python2to3fixes' into maint. 2018-10-16 09:37:25 -07:00
Tom Lofts
820cd842f1 Bug 796893 - invoice.GetDatePosted() and other date related...
functions returns strange values for uninitalised dates.

Convert time64 equal to INT64_MAX to Python's None value.
2018-10-06 14:59:52 -07:00
Mahmoud Yaser
3e014f189f
Update change_tax_code.py 2018-09-26 08:21:17 +02:00
Mahmoud Yaser
f726238865
Update change_tax_code.py 2018-09-24 17:21:16 +02:00
Mahmoud Yaser
3b416f07be
Update change_tax_code.py 2018-09-24 11:12:16 +02:00
Christoph Holtermann
64a28b5263 xrange deprecated in python3, change to range
thanks to Sumit Bhardwaj for the hint
2018-09-22 18:12:11 +02:00
Christoph Holtermann
97916c6682 whitespace fixes 2018-09-21 09:28:41 +02:00
Christoph Holtermann
34fa18f04e additional fixes for python3 2018-09-21 09:27:17 +02:00
Christoph Holtermann
54cb3358ce add basic test for python query
add test for creating query object and setting search_for
related to Bug 796137 and fix in commit 1a7c5b9a32
2018-09-20 18:54:49 +02:00
John Ralls
1a7c5b9a32 Merge Christoff Holterman's Bug 796137 repair into maint. 2018-09-08 13:20:51 -07:00
Christoph Holtermann
3ab66623cd Bug 796137 - implement search_for as method of Python Query
The last three commits fix the main part of Bug 796137. An inconvenience
with GSList remains as for the moment qof_query_add_boolean_match only
accepts bytes as parameter and no strings. This still needs to be fixed.
2018-09-08 09:31:45 +02:00
Christoph Holtermann
0551ee36e8 add option to exclude specified methods
an exclude option is being added to add_constructor_and_methods_with_prefix and
add_methods_with_prefix
2018-09-08 09:26:23 +02:00
John Ralls
fee589b28c Remove Timespec from pricedb.
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
2018-08-13 11:52:42 -07:00
John Ralls
756f444ac3 Update bug tracker URL
Change all instances of bugzilla.gnome.org to bugs.gnucash.org, reflecting
our migration to a self-hosted bug tracker.

Inform the Translation Project Coordinator at release that this affects
translatable strings and that all message catalogs have been updated.
2018-07-13 09:49:33 -07:00
Geert Janssens
1f3cf845c4 Work around a conflict between gcc 8.0 and swig 3.0
The swig 3.0 generated python wrappers trigger a warning converted into an error issued
by gcc 8.0 for using strncpy as follows:
strncpy(buff, "swig_ptr: ", 10);
The reason is this call will truncate the trailing null byte from the string.
This appears to have been fixed in swig master already but that's not released yet
so let disable the warning when compiling the swig wrappers until it is.
2018-05-09 22:18:29 +02:00
Geert Janssens
a9f35ed7ae Lowercase cmake commands
A huge bikeshed fest but it distracted me enough to do it anyway.
2018-05-03 23:18:15 +02:00
Fabian Köster
07a5485814 Fix syntax 2018-04-19 08:32:46 +02:00
John Ralls
a0f49d8b17 Revert "Load the environment file when initializing the python bindings."
It's unnecessary, the swigged gnucash_core init function already does it.
This reverts commit 7b6854c163.
2018-03-25 09:17:17 -07:00
John Ralls
7b6854c163 Load the environment file when initializing the python bindings. 2018-03-24 17:49:01 -07:00
John Ralls
148c02d231 [python bindings] Add required posted dates to the transactions. 2018-03-22 15:29:08 -07:00
John Ralls
bea89a50ac More python 3 fixups. 2018-03-22 15:19:59 -07:00
John Ralls
7989f02c73 Merge Tomas Schlosser's "Allow creation of prices in Python bindings" into unstable. 2018-03-17 15:53:46 -07:00
Julian Wollrath
a43b115a45 Bug 791831 - Add python3 support
This switches swig to use python 3 specific features when generating the
bindings, switches the build over to python 3 and makes the neccesary
python 2 to 3 conversions in the bindings and tests.
2018-03-17 15:10:00 -07:00
Tomas Schlosser
01bb298504
Allow creation of prices in Python bindings
Using the function gnc_price_create and book as a parameter, it is possible to create the new GncPrice object. This will remove the necessity of cloning the prices from existing ones in Python scripts.
2018-03-16 14:25:46 +01:00
John Ralls
c9f3c0760c Provide fallback value for test_core_dir in case it hasn't been built yet. 2018-03-09 13:48:36 -08:00
John Ralls
fbb172d096 Bug 793900 - 2.7.5: test failure: 105 - python-bindings.
unittest_support.py is in ${CMAKE_SOURCE_DIR} for a tarball build
and ${CMAKE_BINARY_DIR} for a vcs build. Look for it rather than
assuming it's in ${CMAKE_BINARY_DIR}.
2018-03-09 13:07:29 -08:00
John Ralls
474c3ae079 Make a target for the python-bindings test to set its dependencies. 2018-02-18 16:08:26 -08:00
Geert Janssens
36cb167b68 Rewrite gnc_add_swig_python_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
4317d8a8f6 Improve handling of generated distributable files
- the two dist_add_... macros now both take a list of file names
as argument so more files can be added at once to the dist tarball.
- dist_add_generated now creates the right target by itself. There's
  no need to pass one any more
- make the swig generated *.py module files explicit output files
- change a couple of custom_targets into custom_commands. The only
  reason they were defined as targets was to ensure they got built
  before the dist tarball. This is now properly handled by the
  dist_add_... macros.
- correctly handle dependency on swig-runtime.h (using OBJECT_DEPENDS
  was not the way to do it according to that property's help page)
2018-01-29 19:46:44 +01:00
Geert Janssens
3dff4e5211 Fix make dist on a clean checkout
cmake with unix makefiles fails to resolve dist dependencies
added from COPY_FROM_BUILD if these dependencies aren't built yet.

This commit replaces the COPY_FROM_BUILD based logic with two new functions
'dist_add_configured' and 'dist_add_generated' to indicate which files should
be included in the dist tarball. The latter also adds a target level dependency
to the dist tarball custom command. Hence the former should
be used for files that get generated during a cmake run while the latter
should be used for files generated as the result of a 'make/ninja-build' run
(like files for which an add_custom_command rule exists).

Note: this commit also temporarily disables the dist target when building
from a tarball (and hence it won't be tested in distcheck either). This
will be handled in a future commit.
2018-01-29 19:46:44 +01:00
John Ralls
74ddb671e4 Merge Chris Lam's and Aaron Laws's branch 'time64-ftw' into unstable. 2018-01-20 12:40:32 -08:00
John Ralls
91f4b19039 Convert python bindings from timespec to time64. 2018-01-20 12:35:04 -08:00
John Ralls
6ffb77de20 Merge branch Rob Gowin's 'bye_bye_autotools' into unstable. 2018-01-18 12:02:56 -08:00
John Ralls
8900b19da3 Bug 790845 - 2.7.3: massive test failures on some architectures (reopened).
Fix some test failures caused by erroneous size assumptions.
2018-01-14 16:31:22 -08:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
Geert Janssens
f11eab36d9 Replace GNC_CONFIGURE(2) with configure_file 2017-12-23 14:07:25 +01:00
John Ralls
ad11afefb4 LIBDIR is not lib--two more CMakeLists.txt. 2017-12-01 20:31:44 -08:00
John Ralls
4a84fca9b1 Add GLIB_CFLAGS and srcdir to SWIG includes. 2017-11-30 13:32:57 -08:00
John Ralls
41656c920e Fix python test failure on Travis.
It seems that there are two possible exceptions depending on OS.
2017-11-28 17:57:00 -08:00
Guy Taylor
744cdac5a4 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.
2017-11-28 17:08:43 -08:00
Guy Taylor
e011576e37 Add GncNumeric to native Python Fraction
Add helper method to return the native Python fraction type from GncNumeric.
2017-11-28 16:14:07 -08:00
Guy Taylor
1ef379a704 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.
2017-11-28 16:14:07 -08:00
John Ralls
e92a1b3723 Fix python tests in tarball builds. 2017-11-28 14:25:24 -08:00
John Ralls
13657ee1bb Merge branch 'maint' into unstable 2017-11-25 15:35:24 -08:00
John Ralls
961cb5a829 Bug 790550 - FTBFS: missing __init__.py 2017-11-19 17:32:12 -08:00
John Ralls
f888eb88f0 Fix with_Python build in cmake. 2017-11-09 11:22:02 -08:00
Geert Janssens
df8ceadb63 Fix building from dist tarball with python bindings enabled 2017-10-26 14:05:17 +02:00
Geert Janssens
1238b9d8cd Prevent gcc from searching config.h in the current directory
This will avoid a ninja-build from picking up a config.h generated by the autotools build
(in the root build directory). Picking up the wrong config.h may lead to all kinds of
subtle issues if the autotools run was done with different options than the cmake run.
2017-10-26 14:05:17 +02:00
Geert Janssens
37ecf56fbb Merge branch 'maint'
Resolved conflicts:
	bindings/python/tests/CMakeLists.txt
2017-09-12 13:48:01 +02:00
Geert Janssens
f0fe1e9949 Re-enable python-bindings test this time with a fully corrected python path
The fix was suggested by Rob Gowin.
In addition, disable some debug output in the python tests suite.
2017-09-10 11:57:28 +02:00