[GRASS-dev] i.rectify should test for illegal file names before launching rectification

Michael Barton michael.barton at asu.edu
Tue Nov 6 10:27:37 EST 2007


Sorry to be dense, but an *optioal* argument *must* be present in i.rectify,
even if it is empty? This seems like a very weird situation.

To do it in TclTk, I'd do it one of two ways, depending on which execution
procedure you are using.

You could just put the whole command in quotes as a string.

set cmd "i.rectify ... extension="

[parse and run] cmd

OR

You could put the command in a list and parse it that way.

set cmdlist [list "i.rectify" "arg1" "arg2" ... "extension="]

[parse and run] cmdlist

Michael




On 11/6/07 4:42 AM, "Moritz Lennert" <mlennert at club.worldonline.be> wrote:

> On 06/11/07 03:25, Michael Barton wrote:
>> 
>> 
>> On 11/5/07 9:10 AM, "Moritz Lennert" <mlennert at club.worldonline.be>
>> wrote:
>> 
>>> BTW anyone know how to give an empty extension in the tcltk gui ?
>>> On the command line I can use extension="", but in the gui I get an
>>> error because of an illegal ".
>> 
>> Moritz,
>> 
>> I'd offer some advice, but I'm not sure I understand what you mean.
> 
> How do you reproduce the following command:
> 
> i.rectify [...] extension=
> 
> in the gui launched when running i.rectify from the menu or from the
> command line without options ?
> 
> Glynn has already pointed out that this seems to be a general deficiency:
> 
> On 06/11/07 11:08, Glynn Clements wrote:
>> 
>> This appears to be a deficiency with the way that the GUI decides
>> whether to pass an option.
>> 
>> G_parser() can distinguish between an absent option and an option
>> with the empty string as its value.
>> 
>> If the GUI treats an empty text field as the option not being given,
>> then there is no way to pass an empty string as an option value.
>> Anything you put into the text field will be passed literally as the
>> option's value.
>> 
>> AFAICT, the only solution is to add a checkbox to each option to
>> force the option to be passed. I suspect that i.rectify won't be the
>> only module where you might want to pass the empty string as an
>> option value.
>> 
>> Note that we have a similar problem with scripts using g.parser. I.e.
>>  there's no way to distinguish between an absent option and the empty
>>  string as the option's value.
> 
> Moritz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list