[GRASS-dev] d.rast.edit in wxgrass

Glynn Clements glynn at gclements.plus.com
Wed Jun 13 11:07:20 EDT 2007


Michael Barton wrote:

> > 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.

No, it's needed to force d.* commands to be intercepted and used to
create layers. It won't work if the d.* command isn't suitable as a
layer command (e.g. d.rast.edit). It also precludes running d.*
commands normally (i.e. using a monitor).

Ignoring the last point, determining whether or not a command can be
used as a layer command isn't as simple as matching against "d.*".

> 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.

The name "menuform.py" suggests that it has something to do with
menus. In which case, what is:

        if cmd[0][0:2] != "d.":

doing in that file (specifically, in mainFrame.OnRun())?

Even if you are determined to use that hack for the CLI, it has no
utility in regard to menus.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list