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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 17 00:20:20 EST 2008


Author: cmbarton
Date: 2008-02-17 00:20:17 -0500 (Sun, 17 Feb 2008)
New Revision: 30202

Modified:
   grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
Log:
Bug fixes and enhancements. Was able to switch back to using gcmd.Command.

Modified: grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py	2008-02-17 04:20:38 UTC (rev 30201)
+++ grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py	2008-02-17 05:20:17 UTC (rev 30202)
@@ -325,7 +325,7 @@
         elif event.GetId() == self.btn_and.GetId(): mark = "&&"
         elif event.GetId() == self.btn_andnull.GetId(): mark = "&&&"
         elif event.GetId() == self.btn_cond.GetId(): mark = "?:"
-        elif event.GetId() == self.btn_brackets.GetId(): mark = "()"        
+        elif event.GetId() == self.btn_paren.GetId(): mark = "()"        
         self.__addSomething(mark)
         
     def OnNewmap(self, event):
@@ -368,12 +368,10 @@
             try:
                 mctxt = self.text_mcalc.GetValue().strip().replace("\n"," ")
                 mctxt = mctxt.replace(" ","")
-                cmdstr = "r.mapcalc '%s=%s'" % (self.newmap,mctxt)
-                print 'cmdstr=',cmdstr
-                cmdlist = ['r.mapcalc', ' %s=%s' % (self.newmap,mctxt)]
-                p = os.system(cmdstr)
-                #p = gcmd.Command(cmdlist, stderr=None)
-                #print p.PrintModuleOutput
+                cmdlist = ["r.mapcalc"," %s=%s" % (self.newmap,mctxt)]
+                p = gcmd.Command(cmdlist)
+                if p.returncode == 0:
+                    wx.MessageBox("Map %s created successfully" % self.newmap)
             except:
                 pass
 



More information about the grass-commit mailing list