Commit Graph

120 Commits

Author SHA1 Message Date
Geert Janssens
d52aa0a0dd app-utils - remove gnc-module boilerplate
app-utils now is an ordinery shared library

A few bits worth mentioning:
1. it's not guile-free just yet, so instead of a gnc_module_load
   your code may have to call scm_c_use_module("gnucash app-utils");
   to expose the scm side of the app-utils api. This call has been
   added to gnucash-bin.c for example
2. while lots of noise in this commit is to rename from gncmodule-app-utils
   to gnc-app-utils, I'll point out the library has also been moved from
   <libdir>/gnucash to <libdir>. This required changes in app-util's
   CMakeLists.txt file for the install side and in the top level
   CMakeLists.txt file for the build directory structure.
3. The C side link module test has been removed as linking an ordinary
   shared library should be considered well tested by the compiler devs.
   The scheme side module load test has been slightly tweaked to no longer
   try to use gnc:module-load, but instead now checks whether the app-utils
   api is properly exposed to scheme after loading it via use-modules.
4. Dropped a completely obsolete README file.
2019-12-06 20:38:21 +01:00
Geert Janssens
0de3dc6bf1 guile/bindings cleanup - only load module gnome-modules when really in use 2019-12-06 20:38:21 +01:00
Geert Janssens
4c77f7670e engine - remove gncmod boilerplate
engine is now an ordinary shared library

This requires a few more places to run gnc_engine_init as
this is no longer done as part of module loading.
2019-12-06 20:38:21 +01:00
Geert Janssens
25cce83f29 gnome-utils - expose wrapped api directly from gnome-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/gnome-utils" 0)
the gnome-utils gncmodule. An ordinary (use-modules (gnucash gnome-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
ee722b85c1 bindings/guile cleanup - fold engine-utilities.scm into engine.scm
It was only exposed via engine.scm anyway and combining them
in one file eliminates one explicit load_extension and sw_engine call.
2019-12-06 20:38:20 +01:00
Geert Janssens
c00bf6bcdb app-utils - expose wrapped api directly from app-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/app-utils" 0)
the app-utils gncmodule. An ordinary (use-modules (gnucash app-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
043c6367a5 gnc-module test updates
- move test modules into a subdirectory on Windows as well
- move the futuremod module into its own subdirectory
  to avoid its load warnings each time gnc_module_init is called
  That also tends to happen when building guile modules.
- remove the log handlers filtering out the futuremodsys warnings
  They didn't match the actual warning signature anyway and
  they're no longer emitted during testing
2019-12-06 19:59:12 +01:00
Geert Janssens
fbd73c83cf gnc-module - move most of scm tests to bindings/guile
This is a first rudimentary separation of gnc-module tests
based on whether they require guile or not. Needs plenty of refinement
which will be applied in followup commits.
2019-12-06 19:59:12 +01:00
Geert Janssens
6eb0ccfa11 gnc-module - move guile wrappers to bindings/guile 2019-12-06 19:59:12 +01:00
Geert Janssens
096a515154 bindings/guile - fix typos in error messages
These were imported verbatim from libgnucash/app-utils/guile-util.c
2019-12-06 19:59:12 +01:00
Geert Janssens
6a3505d01f app-utils - move price-quotes support functions directly into bindings
- wrappers for glib functions go into glib-guile
- engine convenience functions go into gnc-engine-guile
2019-12-06 19:59:12 +01:00
Geert Janssens
d777128e6f app-utils - simplify and move gettext wrappers
1. Instead of creating a C wrapper around gettext to then wrap in
guile, use guile's builtin gettext support directly.

The code still defines the _ and N_ shorthands. However it doesn't
really warant a separate module just for these two shorthands.
Instead define them in core-utils. So all code wanting to use
_ or N_ in guile should now use the (gnucash core-utils) module.

The bulk of this commit is actually deleting the scm-gettext
target and using (gnucash core-utils) instead of (gnucash gettext).

2. As the definition of _ and N_ is removed from app-utils.scm,
the app-utils test for a functional N_ macro has been moved to a
new test file in the guile bindinds tests.

3. The (gnucash gettext) module has been deprecated. Use
(gnucash core-utils) from now on.
2019-12-06 19:59:12 +01:00
Geert Janssens
2e1b9f937b engine - drop guile wrappers for obsolete functions
These were marked deprecated early in the 3.x release cycle.
2019-12-06 19:59:11 +01:00
Geert Janssens
c46c9682eb engine/test - move guile related tests to bindings 2019-12-06 19:59:11 +01:00
Geert Janssens
02511401b7 bindings/guile cosmetic - rename source files for consistency 2019-12-06 19:59:11 +01:00
Geert Janssens
77f669f123 bindings/guile cosmetic - move price-quotes target lower down
This is just a cosmetic. This way the scm targets in the CMakeLists.txt
file are ordered according to their dependencies (targets later in the
file can depend on targets earlier in the file).
2019-12-06 19:59:11 +01:00
Geert Janssens
48f3195e5c bindings - make business-core scm module part of the engine module
There's no reason to expose it as an individual module as what it exports
are support functions for first class engine objects.
2019-12-06 19:59:11 +01:00
Geert Janssens
e940ce8524 engine.scm - a few minor cosmetics
- drop export of non-existing symbol
- add a couple of comments
2019-12-06 19:59:11 +01:00
Geert Janssens
3d4cc63d73 bindings - ensure engine is initialized before any scm code interfaces with it
This is done by invoking gnc_engine_init in the swig initialization routine
2019-12-06 19:59:11 +01:00
Geert Janssens
1c7f835f47 engine - move guile code to bindings/guile
This commit tries to do the minimum necessary to move the guile bits from engine
to bindings/guile. As engine is a very central piece in the software, this unfortunately
still touches many other source files:

- A few helper objects have been squashed together:
  * engine-helpers-guile.[ch] (of which the c part is extracted from engine-helpers.c)
  * gncBusGuile.[ch]
  * gnc-hooks-scm.[ch]
- The initialization function of gncmod-engine no longer initializes the scm bits.
  Any scm code that wants to interact with the engine code now has to load
  the (gnucash engine) scm module, or sometimes (gnucash business-core).
  The bulk of changes in this commit actually is updating all the scm consumers to do so.
- scm-scm target has been removed. Instead (gnucash utilities) is part
  of scm-engine. A few dependency graphs have been updated for this.

More refinements will be in followup commits.
2019-12-06 19:59:11 +01:00
Geert Janssens
49bf27fad5 core-utils - use one command to export all swig wrapped symbols via the (gnucash core-utils) module 2019-12-06 19:59:11 +01:00
Geert Janssens
a6b7eecd81 core-utils - make the swig generated source file dependent on the core-utils headers
That should trigger a regeneration of these swig sources if
any of the header files change.
This is done via a small macro that can be reused for other wrappers as well.

Note
cmake 3.15 introduces a 'FILTER' generator expression
that might allow us to do something like the following:
$<FILTER:$<TARGET_PROPERTY:baselib,SOURCES>,INCLUDE,"*.h[pp]?$">
I toyed briefly with that idea but it currently has two issues:
1. 3.15 is newer than our current minimum cmake requirement, so we can't
   depend in that feature yet.
2. the sources are relative to *their* source directory, which
   is different from the one in which the wrappers are generated
   So they should still be properly transformed into absolute paths
2019-12-06 19:59:11 +01:00
Geert Janssens
a1898daf6c core-utils - move python wrapper code to bindings/python
This makes libgnucash/core-utils completely guile and python free.
2019-12-06 19:59:11 +01:00
Geert Janssens
ad8c388235 core-utils - rework link_libraries and include_directories propagation
By properly marking certain parameters as private or public
we can have cmake work out most of the link_libraries and
include_directoris for other targets dependent on core-utils
2019-12-06 19:59:11 +01:00
Geert Janssens
28fa4c6465 core-utils - move wrapper code to bindings/guile
Note core-utils.i is used by both the guile and the python bindings so
it is moved up to the common bindings directory, while guile
specific changes are in bindings/guile.
2019-12-06 19:59:11 +01:00
Geert Janssens
18093b5e82 core-utils - move guile utils to bindings/guile 2019-12-06 19:59:11 +01:00
Geert Janssens
33e1ff645c Allow to pass include directories to the add_swig_xyz commands
This will be needed when the wrappers no longer live in
the same directory as the objects they are wrapping.
2019-12-06 19:59:11 +01:00
Geert Janssens
e493d42def Introduce gnucash-guile shared library
This (currently empty) library is intented to become
the standard api library for guile code that wants
to use the libgnucash functionality.
2019-12-06 19:59:11 +01:00
Geert Janssens
a0aa105826 libgnucash/scm - move to bindings/guile
A small step in the direction of making libgnucash guile-free.
2019-12-06 19:59:11 +01:00
luz.paz
65bb60d621 Fix typos for gnuchash/ doc/ bindings/ and misc.
Typos found via `codespell -q 3 -D ~/Projects/codespell/codespell_lib/data/dictionary.txt -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,cas,dragable,gae,iff,iif,mut,nd,numer,startd,stoll`
2019-09-13 20:26:03 -04:00
Geert Janssens
15a35e6a3b Housekeeping - replace plenty of http links with https
There are more, but these are most common ones.
There are also a number of urls that don't behave well when https, so those are skipped
At some point I have also started marking non-working URLs as [DEAD LINK], though
that's not a full coverage.
2019-06-06 15:52:30 +02:00
Mike Evans
29416292a9 Remove FIX ME
Since it works fine and I can't remember why I put it in.
2019-05-01 11:46:42 +01:00
John Ralls
fc355958b8 Merge Christoph Holtermann's 'PR-python2to3-rest-api' into maint. 2019-04-14 14:27:53 -07:00
John Ralls
b2f25408d7 Merge Christoff Holtermann's 'PR-python-time64-modifications' into maint 2019-04-14 14:26:35 -07:00
John Ralls
8823f7283f Merge Christoph Holtermann's 'PR-python2to3' into maint. 2019-04-14 14:24:16 -07:00
c-holtermann
0c02866964 PyDate_Check works for date and datetime 2019-04-06 17:13:41 +02:00
c-holtermann
18a2688419 typo 2019-04-06 16:17:58 +02:00
c-holtermann
db9e98a812 also allow datetime.date
Initialisation of some business objects has been done with
datetime.date.today() and it is also mentioned as a possibility
in the source doc. So leave it possible.
2019-04-06 16:10:04 +02:00
c-holtermann
3884e6abf5 unobfuscate get_date method name 2019-04-06 16:09:01 +02:00
c-holtermann
8ba5e552d9 return None object if return value is FALSE 2019-04-06 14:50:29 +02:00
c-holtermann
dafdd702e6 additional author 2019-04-06 14:12:06 +02:00
c-holtermann
79decfb754 deal with functions returning values through arguments 2019-04-06 14:11:55 +02:00
c-holtermann
445ff7e6c9 check for argument type. Also allow int. 2019-04-06 14:11:05 +02:00
c-holtermann
c779bcb72f GetOwner may return project instead of owner 2019-04-04 17:56:42 +02:00
c-holtermann
6925ee3115 be prepared for GetDateDue returning null 2019-04-04 17:56:31 +02:00
c-holtermann
876079f8d2 remove TS suffix 2019-04-04 17:56:24 +02:00
c-holtermann
6eae440534 GetDate return unserializable datetime object 2019-04-04 17:56:16 +02:00
c-holtermann
b73be1b523 GetInvTaxTable returns unserializable object 2019-04-04 17:56:06 +02:00
c-holtermann
b06801185c shebang should be specific to python version (PEP394)
preferred form is #!/usr/bin/env python3 as gnucash now only works with
python3
2019-04-04 17:48:42 +02:00
c-holtermann
e7d940ac3f iteritems removed in python3 2019-04-04 17:48:10 +02:00