ソースを参照

wxGUI: fix launching command without any paramaters

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49898 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 年 前
コミット
f61852a138
1 ファイル変更13 行追加9 行削除
  1. 13 9
      gui/wxpython/gui_core/goutput.py

+ 13 - 9
gui/wxpython/gui_core/goutput.py

@@ -535,18 +535,13 @@ class GMConsole(wx.SplitterWindow):
             
             else:
                 # other GRASS commands (r|v|g|...)
-                if len(command) == 1 and command[0] != 'v.krige':
-                    # no arguments given
-                    try:
-                        GUI(parent = self).ParseCommand(command)
-                    except GException, e:
-                        print >> sys.stderr, e
-                    return 0
-                
                 task = GUI(show = None).ParseCommand(command)
+                hasParams = False
                 if task:
+                    options = task.get_options()
+                    hasParams = options['params'] and options['flags']
                     # check for <input>=-
-                    for p in task.get_options()['params']:
+                    for p in options['params']:
                         if p.get('prompt', '') == 'input' and \
                                 p.get('element', '') == 'file' and \
                                 p.get('age', 'new') == 'old' and \
@@ -558,6 +553,15 @@ class GMConsole(wx.SplitterWindow):
                                                                          'opt': p.get('name', '') })
                             return 1
                 
+                if len(command) == 1 and hasParams and \
+                        command[0] != 'v.krige':
+                    # no arguments given
+                    try:
+                        GUI(parent = self).ParseCommand(command)
+                    except GException, e:
+                        print >> sys.stderr, e
+                    return 0
+                
                 # switch to 'Command output' if required
                 if switchPage:
                     self._notebook.SetSelectionByName('output')