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

Anna Petrášová kratochanna at gmail.com
Thu Aug 20 04:48:36 PDT 2015


On Thu, Aug 20, 2015 at 7:14 AM, Markus Neteler <neteler at 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 at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150820/1d6b4842/attachment.html>


More information about the grass-dev mailing list