[GNC] Should the gnc-fq-* helper scripts be invoked as commands, or as an arg to perl?

Frank H. Ellenberger frank.h.ellenberger at gmail.com
Mon Jun 14 14:58:43 EDT 2021


Hello Jim,

I fear this changes would go in the wrong direction. It would hide the
important "normal" stuff behind a bunch of noise.

Instead of adding aphavantage and probably other keys to each command,
explain for your OSes, how to add them to the environment on each login.
IIRC future FQ release will handle it different.

Instead of adding -{w|W} to each command, explain them in the
troubleshooting section and perhaps how to add them to perls configuration.

The gnc-fq-* scripts have a shebang and Windows it the only OS without
the mechanism.

The main purpose ofthe helper scripts is not to mimic GnuCash's call but
to find out why it is not working as expected.

Regards
Frank

Am 14.06.21 um 05:44 schrieb Jim DeLaHunt:
> On 2021-06-13 00:39, Jim DeLaHunt wrote:
> 
>> Am I correct in guessing that GnuCash 4.5 internally invokes these
>> scripts (maybe just gnc-fq-helper) as an argument to a perl command?
> 
> After a fairly quick read of the source code, I think the answer is,
> "Yes, for over 14 years". I see in gnucash/price-quotes.scm:120-122:
> 
>     (define (start-quoter)
>           (set! quoter
>             (gnc-spawn-process-async (list "perl" "-w"
> gnc:*finance-quote-helper*) #t)))
> 
> I interpret this as meaning that GnuCash fetches quotes by spawning a
> process with arguments like:
> 
> perl -w /path/to/helpers/gnc-fq-helper ...[args giving security for
> which to get quotes]...
> 
> It looks to me like this code has been much the same since commit
> c38bcd3 on 2007-04-28.  Looking at the code it replaced, I suspect that
> GnuCash used to invoke the scripts directly, without the "perl" "-w"
> part. But that was long ago.
> 
> There are comments in libgnucash/quotes/gnc-fq-help.in:75,92 which imply
> direct invocation. They have examples like:
> 
> $ echo '(alphavantage "CSCO" "JDSU" "^IXIC")' | ./gnc-fq-helper
> 
> But that will only get read by developers, who aren't as easily misled
> as non-developer users.
> 
> 
>> If so, should the wiki page
>> https://wiki.gnucash.org/wiki/Online_Quotes use the same invocation?
> 
> I am now of the opinion that, yes, it should.
> 
> I think that we should guide users to invoke the helper scripts is a
> similar way to how GnuCash actually invokes them. This will help reduce
> user confusion, by making their results more closely match GnuCash's
> results.
> 
> I propose to change every invocation on that page from a bare name of
> the helper script
> 
> e.g. gnc-fq-dump currency USD EUR
> 
> to something like
> 
> perl -w gnc-fq-dump currency USD EUR
> 
> I will also make sure there is a clear explanation that the above
> abbreviates the path to the helper scripts and the AlphaVantage key. The
> actual invocation is actually more like:
> 
> $ ALPHAVANTAGE_API_KEY=01234ABCD perl -w
> /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump currency
> USD EUR
> 
> I will also deemphasise the mention of the shebang (#!). It looks like
> the invocation which GnuCash actually uses does not rely on shebang, so
> we should not be leading users to pay attention to it.
> 
> 
> Are there objections to me being bold and making such changes?
> 
> Best regards,
>      —Jim DeLaHunt
> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list