[Kmymoney-devel] WebPriceQuote object
fvilas at iname.com
Thu Sep 17 04:40:25 CEST 2009
On Wednesday 16 September 2009 03:32:52 tonyb wrote:
> First off, sit well back from your screens. I've just had the flu and
> wouldn't like to infect you all :-)
Get well soon...
> On Wednesday 16 Sep 2009 00:33:11 Alvaro Soliverez wrote:
> > >> There are several code paths for non-interactive executables,
> > >> controlled by
> > >> checking "if (! kapp)". kapp is always true, whether it is set to
> > >> false in
> > >> main() in kmymoney2/kmymoneytest.cpp or not.
> I always assumed that this test was to detect whether we were in unit test
> or application mode, though I can't quite remember how I came to that
> conclusion! I presumed the idea was to do unit tests offline.
That's exactly what it is for, but there needs to be a kapp object for KGlobal
to work in some other code, so the object always exists. Before that was
implemented (before I started on the quote objects), kapp could be set to
null, and the check would work as designed. At this point, it does nothing.
WebPriceQuote::quoteSourcesFinanceQuote() relies on KGlobal to get the
location of financequote.pl, so removing it wouldn't serve much purpose anyway,
unless we didn't want to test that branch. I'm in favor of testing as many
branches as possible.
> > >> is a separate class for handling the Perl Finance::Quote script, so I
> > >> don't
> > >> really know how to test this branch. Does anyone have an example, or
> > >> would
> > >> you suggest removing this branch, and creating a class similar to the
> > >> one for
> > >> Finance::Quote if/when more scripts are added?
> I added the Finance::Quote branch when I rewrote the Gnucash importer,
> since F::Q is what Gnucash uses (or used to anyway). I'm not sure of the
> support status of that package these days, so I wouldn't be surprised to
> find that some sources no longer work.
> I also wrote the financequote.pl script, based on one supplied by Gnucash.
> They also had a script called update-finance-quote which would upgrade to
> the latest version. I just installed Gnucash 2.3 and I don't see it there.
> I'll look into it a bit.
Well, F::Q works for the "usa" source. I'll add a check for the others, since
those can be found on the cpan page for the module. An update script would be
nice, but if they don't have one, it can either be recreated or ignored. The
script looks good for now, and any new sources would be available by updating
F::Q in cpan.
The main thing not working right now is quotes not from the Yahoo or F::Q
I'm going to commit it as-is for now, since it compiles and passes the enabled
unit tests. I'll do some code cleanup and add more tests for a second commit
later this week/weekend. If anyone has trouble with the first version, let me
know, and I'll try to get it fixed in the second.
fvilas at iname.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20090916/b2994516/attachment.sig
More information about the KMyMoney-devel