[GRASS-SVN] r45770 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 26 16:20:10 EDT 2011


Author: martinl
Date: 2011-03-26 13:20:10 -0700 (Sat, 26 Mar 2011)
New Revision: 45770

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: use utils.split() instead of shlex.split()


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-03-26 20:12:05 UTC (rev 45769)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-03-26 20:20:10 UTC (rev 45770)
@@ -41,7 +41,6 @@
 
 import os
 import sys
-import shlex
 import time
 import traceback
 import getpass
@@ -2396,9 +2395,9 @@
             list()
         
         try:
-            cmd = shlex.split(str(line))
+            cmd = utils.split(str(line))
         except UnicodeError:
-            cmd = shlex.split(utils.EncodeString((line)))
+            cmd = utils.split(utils.EncodeString((line)))
             
         return cmd
     

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-03-26 20:12:05 UTC (rev 45769)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-03-26 20:20:10 UTC (rev 45770)
@@ -432,7 +432,7 @@
         display widget that currently has the focus (as indicted by
         mdidx).
         
-        @param command command given as a list (produced e.g. by shlex.split())
+        @param command command given as a list (produced e.g. by utils.split())
         @param compReg True use computation region
         @param switchPage switch to output page
         @param onDone function to be called when command is finished

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py	2011-03-26 20:12:05 UTC (rev 45769)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py	2011-03-26 20:20:10 UTC (rev 45770)
@@ -13,11 +13,10 @@
 @author Martin Landa <landa.martin gmail.com>
 """
 
-import shlex
-
 import wx
 
 import globalvar
+import utils
 
 class Menu(wx.MenuBar):
     def __init__(self, parent, data):
@@ -69,9 +68,9 @@
         
         if gcmd: 
             try: 
-                cmd = shlex.split(str(gcmd)) 
+                cmd = utils.split(str(gcmd)) 
             except UnicodeError: 
-                cmd = shlex.split(utils.EncodeString((gcmd))) 
+                cmd = utils.split(utils.EncodeString((gcmd))) 
             if cmd and cmd[0] not in globalvar.grassCmd['all']: 
                 menuItem.Enable(False)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-03-26 20:12:05 UTC (rev 45769)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-03-26 20:20:10 UTC (rev 45770)
@@ -51,7 +51,6 @@
 import types
 from threading import Thread
 import Queue
-import shlex
 import tempfile
 
 ### i18N
@@ -2230,7 +2229,7 @@
         sys.exit(_("usage: %s <grass command>") % sys.argv[0])
     if sys.argv[1] !=  'test':
         q = wx.LogNull()
-        cmd = shlex.split(sys.argv[1])
+        cmd = utils.split(sys.argv[1])
         task = grassTask(cmd[0])
         task.set_options(cmd[1:])
         app = GrassGUIApp(task)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2011-03-26 20:12:05 UTC (rev 45769)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2011-03-26 20:20:10 UTC (rev 45770)
@@ -21,7 +21,6 @@
 
 import os
 import sys
-import shlex
 import copy
 import difflib
 import codecs
@@ -214,7 +213,7 @@
              col = self._colSearch
          itemtext = self.dropdownlistbox.GetItem(sel, col).GetText()
          
-         cmd = shlex.split(str(self.GetValue()))
+         cmd = utils.split(str(self.GetValue()))
          if len(cmd) > 0 and cmd[0] in self._choicesCmd:
              # -> append text (skip last item)
              if self._choiceType == 'param':
@@ -339,7 +338,7 @@
             return
         
         try:
-            cmd = shlex.split(str(text))
+            cmd = utils.split(str(text))
         except ValueError, e:
             self.statusbar.SetStatusText(str(e))
             cmd = text.split(' ')



More information about the grass-commit mailing list