[GRASS-SVN] r40126 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 24 07:08:44 EST 2009


Author: martinl
Date: 2009-12-24 07:08:43 -0500 (Thu, 24 Dec 2009)
New Revision: 40126

Modified:
   grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI/prompt: don't fail on IndexError


Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-24 11:50:22 UTC (rev 40125)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-24 12:08:43 UTC (rev 40126)
@@ -497,7 +497,7 @@
     def __init__(self, parent):
         self.parent = parent                 # GMConsole
         self.panel  = self.parent.GetPanel()
-
+        
         if self.parent.parent.GetName() != "LayerManager":
             self.standAlone = True
         else:
@@ -747,7 +747,11 @@
             
             pos = self.GetCurrentPos()
             entry = self.GetTextLeft()
-            cmd = entry.split()[0].strip()
+            try:
+                cmd = entry.split()[0].strip()
+            except IndexError:
+                cmd = ''
+            
             if cmd not in globalvar.grassCmd['all']:
                 return
             



More information about the grass-commit mailing list