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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 2 07:41:21 EST 2011


Author: martinl
Date: 2011-12-02 04:41:21 -0800 (Fri, 02 Dec 2011)
New Revision: 49489

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/vclean.py
Log:
wxGUI/v.clean: check input parameters, define OnDone handler


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/vclean.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/vclean.py	2011-12-02 12:33:57 UTC (rev 49488)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/vclean.py	2011-12-02 12:41:21 UTC (rev 49489)
@@ -451,13 +451,31 @@
 	else:
 	    self.selected = -1
 
+    def OnDone(self, cmd, returncode):
+        """!Command done"""
+        self.SetStatusText('')
+
     def OnCleaningRun(self, event):
         """!Builds options and runs v.clean
         """
+        self.GetCmdStrings()
+
+        err = list()
+        for p, name in ((self.inmap, _('Name of input vector map')),
+                        (self.outmap, _('Name for output vector map')),
+                        (self.tools_string, _('Tools')),
+                        (self.thresh_string, _('Threshold'))):
+            if not p:
+                err.append(_("'%s' not defined") % name)
+        if err:
+            gcmd.GError(_("Some parameters not defined. Operation "
+                          "cancelled.\n\n%s") % '\n'.join(err),
+                        parent = self)
+            return
+
 	self.SetStatusText(_("Executing selected cleaning operations..."))
         snum = len(self.toolslines.keys())
-	self.GetCmdStrings()
-
+        
         if self.log:
 	    cmd = [ self.cmd,
                     'input=%s' % self.inmap,
@@ -469,7 +487,7 @@
 	    if self.overwrite.IsChecked():
 		cmd.append('--overwrite')
             
-            self.log.RunCmd(cmd)
+            self.log.RunCmd(cmd, onDone = self.OnDone)
             self.parent.Raise()
         else:
 	    if self.overwrite.IsChecked():



More information about the grass-commit mailing list