[GRASS-dev] d.rast.edit in wxgrass
Michael Barton
michael.barton at asu.edu
Tue Jun 12 13:26:49 EDT 2007
On 6/12/07 9:25 AM, "Glynn Clements" <glynn at gclements.plus.com> wrote:
>
> Michael Barton wrote:
>
>>>> d.rast.edit ought to run from wxgrass, assuming that TclTk is installed. It
>>>> launches the wxPython properties dialog when called from the menu. However,
>>>> the wxPython properties dialog, then launches the TclTk properties dialog
>>>> instead of just running the command (note that running d.rast.edits with
>>>> arguments runs fine from the wxgrass built in CLI).
>>>>
>>>> The place where the command is getting rerouted to call the TclTk dialog
>>>> seems to be in line 636 of menuform.py
>>>
>>> It's being treated as a layer because it begins with "d.".
>>>
>>> The "d.*" hack is a bad idea; I suggest that you remove it.
>>
>> I'm not sure why the d.* clause is in this particular place--one reason to
>> query Daniel who has done most of the work making menuform work well.
>>
>> We need to split out d.* commands elsewhere because they must be processed
>> differently from other commands in order to show up in the display canvas,
>> but this would not apply to d.rast.edit. It is the only command that I know
>> of that would handle it's own display still.
>
> d.* commands used as map layers belong in a separate menu. The menu
> items for layer commands should have different bindings to normal
> commands.
>
> Determining how to run a command based upon its name is simply wrong.
This is needed, at least in some spots to permit running d.* commands from
the CLI. That's why it needs to look at the name.
If it was only from the menu, then it would be easy. I don't know if this is
the case in menuform. I don't know exactly what is going on in this spot and
haven't had time yet to figure it out.
>
>>>> retcode = subprocess.call(cmd, shell=True)
>>>
>>> Why are you using a string instead of a list?
>>
>> I looked at cmd coming in and I think it is a list.
>
> In which case, the shell=True doesn't belong there.
This may be the immediate problem. I'll test.
Michael
>
>> It should be possible to port d.rast.edit (or its functionality) to
>> wxPython, since it is TclTk, at which time we'd just change the call in the
>> menu to aim at the new one. Nviz launches fine, as do the xterm commands.
>> d.rast.edit is the only one that doesn't launch quite right. It's not a
>> biggie, but if it is an easy fix, it would be nice.
>
> The fix for d.rast.edit is to remove the hack which treats d.*
> commands differently.
__________________________________________
Michael Barton, Professor of Anthropology and Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and 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