[GRASS-dev] Default content for the "answer" to G_OPT_F_INPUT

Nikos Alexandris nik at nikosalexandris.net
Wed Apr 18 03:01:11 PDT 2018


* Moritz Lennert <mlennert at club.worldonline.be> [2018-04-18 11:13:53 +0200]:

>On 18/04/18 10:50, Nikos Alexandris wrote:
>>Vaclav:
>>
>>>Hi Nikos,
>>>
>>>I'm sorry if my comment is out of topic as I'm not following the whole
>>>discussion, but can you just hardcode the values in the code and allow them
>>>to be overridden by the user-specified file? That is much simpler (for both
>>>user and GRASS) than handling paths and if the file is short, it does not
>>>raise major code cleanness concern. If people need to edit the file, then
>>>documentation is the appropriate place.
>>
>>Hi Vaclav,
>>
>>I can do what you suggest. It is not, however, what I want to do.
>>
>>By referring to "a string as the content of a default answer for
>>G_OPT_F_INPUT" I mean exactly this: the content of the answer. The answer is a
>>file name. It's content is a string.
>>
>>Example: one want to use a GRASS GIS module, say through QGIS. If one
>>sees an example set of rules in the corresponding box, right away when
>>launching the GUI (or r.SomeModule --ui), it is easier to grasp the syntax and
>>successively the logic of whatever is shown.
>>
>>I can't figure out a way in Python on how to set this content without
>>using an external file.
>>
>>Would you devs think it makes sense to request, via a
>>ticket, an option for the parser to fill in, in addition to the existing
>>"answer" to G_OPT_F_INPUT (which will fill in a file name, and if the
>>file exists, its content will be printed in the larger box below it), an
>>in-script hardcoded string as the content that will be "loaded" in this
>>larger box?
>>
>>Maybe name it "content" or "rules" or "filecontent" or something
>>similar?
>
>IIUC, what you would like to be able to do is to prefill the text box 
>that you have, for example, in in the r.reclass GUI under "or enter 
>values directly" (see attached screenshot) ?

Correct (first post, last sentence -- apologies if it was not clear
enough). It will enable a better user-experience, the way I understand
GRASS GIS.

Nikos

>Moritz



-- 
Nikos Alexandris | Remote Sensing & Geomatics
GPG Key Fingerprint 6F9D4506F3CA28380974D31A9053534B693C4FB3 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180418/81a91956/attachment.sig>


More information about the grass-dev mailing list