Ticket #1409 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

wxGUI command console does not parse correctly "help" and first parameter

Reported by: philippbs Owned by: martinl
Priority: normal Milestone: 6.4.2
Component: wxGUI Version: svn-releasebranch64
Keywords: cmd, d. Cc: grass-dev@…
Platform: All CPU: x86-64

Description

The wxGUI command line console does not parse commands correctly, critically the 'help' option does not work. e.g.

d.vect help

results in

ERROR: Rendering failed

and erases the map display and it leads to the undesired creation of a layer 'help' in the Map Layers tab.

Similarly, implicit parameter declarations are not parsed, e.g. (using the North Carolina dataset)

d.vect streams  

results in the same error message as above and the creation of a layer 'streams' in Map Layers.

Change History

  Changed 3 years ago by neteler

  • platform changed from MSWindows 7 to All

Confirmed on Linux.

In GRASS 7, on Linux the usage of "d.vect help" in the cmd console leads instead to:

Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/prompt.py", line 1097, in
OnKeyPressed

self.parent.RunCmd(cmd)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/goutput.py", line 506, in
RunCmd

layerType = layertype)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/utils.py", line 144, in
GetLayerNameFromCmd

dcmd[i] = p + '=' + v
TypeError
:
unsupported operand type(s) for +: 'NoneType' and 'str'

  Changed 3 years ago by cmbarton

The command console is not designed to support the in-terminal help. Instead, pressing the <tab> key will show the command syntax, much like typing help. There needs to be a better error trap when "help" is typed to inform the user of that.

There is also a full help manual as a tab in every command module.

  Changed 3 years ago by cmbarton

I stand corrected. If you type the command, followed by "help", the standard terminal help will print to the console output window.

This works for all commands EXCEPT d.* commands. When I type a d.* command, followed by "help", I get an error "Error: rendering failed" and all subsequent attempts to display a map in the window fail (with the same error). It acts like I've switched to the Cairo driver, but the display says it is still on the PNG driver.

Some weird bug here.

  Changed 3 years ago by cmbarton

Figure it out. Overly simple. Needs a better error trap

Typing "d.rast help" in the command console adds a blank map layer named "help" to the list of layers, obscuring all layers below. It also generates the "rendering failed" error because it cannot render the non-existant map "help".

in reply to: ↑ description   Changed 3 years ago by martinl

  • cc grass-dev@… added
  • keywords cmd, d. added
  • status changed from new to assigned
  • owner changed from grass-dev@… to martinl

Replying to philippbs:

The wxGUI command line console does not parse commands correctly, critically the 'help' option does not work. e.g.

> d.vect help

try out r47251 (backported in r47252 to devbr6 for testing).

d.vect help

should print out usage of the module.

d.vect stream

should add stream map (from search path) to layer tree. After some testing it could be backported to relbr64.

  Changed 3 years ago by neteler

I have tested r47252 (6.5), works now. I have also tested -help and --help, works, too. Thanks!

  Changed 3 years ago by cmbarton

I just tested this too, and it works.

Thanks.

  Changed 3 years ago by cmbarton

  • status changed from assigned to closed
  • resolution set to fixed

  Changed 3 years ago by martinl

Backported to relbr64 in r47256. Now ticket can be closed.

Note: See TracTickets for help on using tickets.