mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user