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.
This commit is contained in:
John Ralls
2021-03-14 09:54:11 -07:00
parent 4be6c63539
commit a6276708c0

View File

@@ -23,10 +23,6 @@
use strict;
use English;
use FileHandle;
# Date::Manip provides ParseDate, ParseDateString, and UnixTime.
use Date::Manip;
=head1 NAME
@@ -112,15 +108,14 @@ non-zero - failure
=cut
# Set a base date with the current time in the current TZ:
my $base_date = new Date::Manip::Date;
$base_date->parse("now");
# The methods we know about. For now we assume they all have the same
# signature so this works OK.
sub check_modules {
my @modules = qw(Finance::Quote Date::Manip);
# Date::Manip provides ParseDate, ParseDateString, and UnixTime.
my @modules = qw(FileHandle Finance::Quote Date::Manip);
my @missing;
foreach my $mod (@modules) {
@@ -149,6 +144,13 @@ sub check_modules {
exit 1;
}
# Check for and load non-standard modules
check_modules ();
# Set a base date with the current time in the current TZ:
my $base_date = new Date::Manip::Date;
$base_date->parse("now");
sub schemify_string {
my($str) = @_;
@@ -319,9 +321,6 @@ sub parse_input_line {
#---------------------------------------------------------------------------
# Runtime.
# Check for and load non-standard modules
check_modules ();
# Create a stockquote object.
my $quoter = Finance::Quote->new();
my $prgnam = "gnc-fq-helper";