[GRASS-dev] wxGUI command line: white space between - and flag name generates Python error

Hi,

if one enters (note the white space)

g.proj - w

into the wxGUI cmd line, then Python gets unhappy with:

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

self._runCmd(self.GetCurLine()[0].strip())
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/prompt.py", line 118, in
_runCmd

self.promptRunCmd.emit(cmd=cmd)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/signal.py", line 229,
in emit

dispatcher.send(signal=self, *args, **kwargs)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/dispatcher.py", line
349, in send

**named
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/robustapply.py", line
60, in robustApply

return receiver(*arguments, **named)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/goutput.py", line 106, in
<lambda>

self._gconsole.RunCmd(command=cmd))
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/core/gconsole.py", line 470, in
RunCmd

task = GUI(show=None).ParseCommand(command)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/forms.py", line 2363, in
ParseCommand

if option[1] == '-':
IndexError
:
string index out of range

Is there a way to catch that?

thanks
Markus

On Thu, Aug 20, 2015 at 7:14 AM, Markus Neteler <neteler@osgeo.org> wrote:

Hi,

if one enters (note the white space)

g.proj - w

into the wxGUI cmd line, then Python gets unhappy with:

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

self._runCmd(self.GetCurLine()[0].strip())
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/prompt.py", line 118, in
_runCmd

self.promptRunCmd.emit(cmd=cmd)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/signal.py", line 229,
in emit

dispatcher.send(signal=self, *args, **kwargs)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/dispatcher.py", line
349, in send

**named
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/etc/python/grass/pydispatch/robustapply.py", line
60, in robustApply

return receiver(*arguments, **named)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/goutput.py", line 106, in
<lambda>

self._gconsole.RunCmd(command=cmd))
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/core/gconsole.py", line 470, in
RunCmd

task = GUI(show=None).ParseCommand(command)
  File "/home/neteler/software/grass70/dist.x86_64-unknown-
linux-gnu/gui/wxpython/gui_core/forms.py", line 2363, in
ParseCommand

if option[1] == '-':
IndexError
:
string index out of range

Is there a way to catch that?

Try r65975.

Cheers,

Anna

thanks
Markus
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Thu, Aug 20, 2015 at 1:48 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

On Thu, Aug 20, 2015 at 7:14 AM, Markus Neteler <neteler@osgeo.org> wrote:

Hi,

if one enters (note the white space)

g.proj - w

into the wxGUI cmd line, then Python gets unhappy with:

...

Try r65975.

Excellent, now that works fine and an error window pops up as expected.

thanks
Markus