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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 13 09:16:53 EDT 2010


Author: mmetz
Date: 2010-10-13 06:16:53 -0700 (Wed, 13 Oct 2010)
New Revision: 43883

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
Log:
bugfix when calling i.rectify

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-10-12 14:51:29 UTC (rev 43882)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-10-13 13:16:53 UTC (rev 43883)
@@ -287,9 +287,9 @@
             return False
 
         if grc == 'target':
-            os.environ["GISRC"] = str(self.target_gisrc)
+            os.environ['GISRC'] = str(self.target_gisrc)
         elif grc == 'source':
-            os.environ["GISRC"] = str(self.source_gisrc)
+            os.environ['GISRC'] = str(self.source_gisrc)
 
         return True
     
@@ -441,7 +441,7 @@
         self.xygroup = ''
 
         # default extension
-        self.extension = 'georect' + str(os.getpid())
+        self.extension = '.georect' + str(os.getpid())
 
         #
         # layout
@@ -1325,16 +1325,31 @@
 
         if maptype == 'cell':
             self.grwiz.SwitchEnv('source')
-            cmdlist = ['i.rectify','-a','group=%s' % self.xygroup,
-                       'extension=%s' % self.extension,'order=%s' % self.gr_order]
+
             if self.clip_to_region:
-                cmdlist.append('-c')
-            
-            self.parent.goutput.RunCmd(cmdlist, compReg=False,
-                                       switchPage=True)
-            
-            time.sleep(.1)
+                flags = "ac"
+            else:
+                flags = "a"
 
+            busy = wx.BusyInfo(message=_("Rectifying images, please wait..."),
+                               parent=self)
+            wx.Yield()
+
+            ret, msg = gcmd.RunCommand('i.rectify',
+                                  parent = self,
+                                  getErrorMsg = True,
+                                  quiet = True,
+                                  group = self.xygroup,
+                                  extension = self.extension,
+                                  order = self.gr_order,
+                                  flags = flags)
+
+            busy.Destroy()
+
+            # provide feedback on failure
+            if ret != 0:
+                print >> sys.stderr, msg
+                
         elif maptype == 'vector':
             outmsg = ''
             # loop through all vectors in VREF



More information about the grass-commit mailing list