Commit Graph

36 Commits

Author SHA1 Message Date
John Ralls
07d8ebd90c Add JSON::Parse to gnc-fq-update.
Required by finance-quote-wrapper to interpret quoter output.
2023-03-10 12:51:30 -08:00
Richard Cohen
3a7464a312 Remove redundant uses of cmake -E env
- In GncAddTest, set_tests_properties() is already setting the env
- In the other uses, there is no change to the environment
2023-03-07 15:44:43 +00:00
John Ralls
fe9b23ff2b [price quotes] Pass short errors to gnc-quotes.
And wordier but not translated messages when STDERR is a tty.
2022-10-14 10:26:51 -07:00
John Ralls
88d658fef0 [price-quotes] Date::Manip is no longer required. 2022-10-13 14:58:27 -07:00
John Ralls
673a925554 [price-quotes] Remove superseded gnc-fq-dump and Quotes-example.pl 2022-10-02 11:50:26 -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
Geert Janssens
bf357315fd finance-quote-wrapper - implement check and fetch in one file via command line switches
This obsoletes gnc-fq-check as the same function can now be
performed with 'finance-quote-wrapper -v'
2022-10-02 11:50:26 -07:00
Geert Janssens
f3fdc5de12 Rewrite gnc-fq-helper as finance-quote-wrapper
This rewritten version takes JSON input and spits out JSON.
Additionally inverted currency quotes will only be flagged.
The old code also swapped currencies in the result.
GncQuotes will be written towards these new implementation
choices.
2022-10-02 11:50:25 -07:00
Geert Janssens
466db526b2 Move source files for GncQuotes to app-utils
It will depend on functions in that library. This can probably be
fixed by cleaning up app-utils, but that's not the topic of
this feature.
2022-10-02 11:50:25 -07:00
Geert Janssens
9d62755b4a Make GncQuotes::check() a private function, returning nothing
At the same time do an explicit reinstantiation of quotes_cached at first use
to work around what seems to be a race condition between static instantiation
and binreloc.
2022-10-02 11:50:25 -07:00
Geert Janssens
32df095d4f Catch potential boost::process exceptions
Could happen if the perl executable isn't found and perhaps also
if there's a stream exception.
2022-10-02 11:50:25 -07:00
Geert Janssens
d79306f7db Protect boost process output read loop from deadlock
As per the boost::process tutorials
2022-10-02 11:50:25 -07:00
Geert Janssens
8b772384cd Various performance fixes based on feedback
- const correctnes
- avoid unnecessary copying
- avoid need to reverse GList
2022-10-02 11:50:25 -07:00
Geert Janssens
2f7ed7f25d Initial version of libgnc-quotes
This library intends to wrap Finance::Quote the way price-quotes.scm currently does.
In this first commit the library replaces price-quotes.scm's library to install
quote sources. In addition it exposes a new command line parameter  in gnucash-cli
to show which version of Finance::Quote is installed on the system (if any) and
which quotes sources that verions exposes.
2022-10-02 11:50:25 -07:00
John Ralls
edad194389 Bug 798180 - Update to macOS Big Sur 11.3 breaks Finance Quote
Added new dependency Test2 to gnc-fq-update. This is a second-order
dependency of Finanance::Quote that CPAN doesn't seem to recognize
on its own.
2021-09-11 16:09:55 -07:00
John Ralls
a6276708c0 Bug 797630 - Check for missing dependencies of 'Get Quotes'...
to avoid Gnucash crash.

We already did, just not in the right order to get the error to
percolate up to price-quotes.scm.
2021-03-14 10:48:25 -07:00
Frank H. Ellenberger
6bc8679932 I18N: replace several spourious spaces 2021-02-22 17:56:50 +01:00
Sebastian Ovide
49ce463aaa
sorting sources
I've did a small bash script that retrieve the sources from gnc-fq-dump and try to find one source that has the specific stock. At that point I've noticed that the sources returned by Finance::Quote have always a different order. Just wondering if it is done in that way intentionally (?)
2021-01-10 15:09:51 +00:00
goodvibes2
60da4bd7bf gnc-fq-dump: Err msg if AlphaVantage API Key is needed but missing
AlphaVantage API Key is needed for all currency quotes
and stock quotes with source 'alphavantage' or 'vanguard' or
multi sources that include 'alphavantage'
2020-06-12 15:11:53 +10:00
goodvibes2
ec08fc1d1a gnc-fq-dump: add examples to synopsis + remove tabs 2020-06-12 15:05:53 +10:00
Mike Alexander
5660fde36a Don't reference undefined variable if price is not set. 2020-06-09 02:10:25 -04:00
Frank H. Ellenberger
82987e13f3 gnc-fq-dump: fix warning on argv
Scalar value @ARGV[0] better written as $ARGV[0] at gnc-fq-dump line
160.
2020-03-13 21:22:19 +01:00
Frank H. Ellenberger
56fa959ec0 Apply @PERL@ -w substitution on gnc-fq-dump, too 2020-03-13 20:53:15 +01:00
Geert Janssens
b7479e8fb0 Bump minimum cmake version to 3.5
This version is available for all supported platforms and distros
(CentOS can have a version via EPEL, which is required anyway)

Advantages:
- one cmake version for all platforms
- we can drop all conditions based on cmake version
2019-05-25 12:04:51 +02:00
John Ralls
fc567208f3 Bug 797233 - Balance Sheet, Chart of Accounts, and other reports...
crash when involving foreign currency stocks.

Scheme's inexact->exact function just converts the floating-point
representation of a number into an exact rational (documented in the
API Reference, Simple Generic Data Types, Numerical data types, Exact
and Inexact Numbers), which isn't what we want.

We want the number converted to exact directly from the string and to do
that we have gnc-fq-helper preface it with #e.
2019-05-14 13:34:07 -07:00
Mike Alexander
5bd7875437 Revert the part of 923b01e2 which reverses currency quotes less than 1.
Now that GnuCash uses 64 bit numbers in numerics this is not necessary.
It can store a number as small as 1e-9 with 9 significant digits.
2019-01-28 19:25:34 -05: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
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
Rob Gowin
bee2925ecc Remove gnc-value-portfolio references from dist lists.
File itself was removed in c0fd3b3.
2018-01-05 10:09:40 -06:00
John Ralls
c0fd3b3165 Remove all references to the now-defunct Yahoo! quote retrieval
And make Alphavantage the default.
2018-01-02 10:43:49 -08:00
Geert Janssens
ddfd38d8c3 Remove cmake hoop to change file permissions
As we are using cmake's own configure_file command, it will just copy
the permissions of the input file, which is what we want here.
2017-12-23 14:07:25 +01:00
Geert Janssens
f11eab36d9 Replace GNC_CONFIGURE(2) with configure_file 2017-12-23 14:07:25 +01:00
John Ralls
9b0a8723a4 More GNUInstallDirs path fixes. 2017-12-01 13:56:52 -08:00
Geert Janssens
649a6a263e Fix installation destinations for overrides and quotes scripts
Mentioned by Robert Gowin and Christopher Lam
2017-11-30 17:37:32 +01:00
John Ralls
5204100d53 Use GNUInstallDirs in CMake Builds
Provides correct file layout when building distribution tarballs.
Fixes Bugs 790840 and 790841.
2017-11-28 14:25:35 -08:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00