[GRASS-SVN] r64598 - grass/branches/releasebranch_7_0/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 12 19:00:53 PST 2015


Author: annakrat
Date: 2015-02-12 19:00:53 -0800 (Thu, 12 Feb 2015)
New Revision: 64598

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py
Log:
wxGUI/start up: avoid error message after multiband import when creating location (merge from trunk, r64570,r64597)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py	2015-02-13 02:59:17 UTC (rev 64597)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py	2015-02-13 03:00:53 UTC (rev 64598)
@@ -515,9 +515,8 @@
             self.lbmapsets.SetSelection(0)
             self.SetLocation(self.gisdbase, gWizard.location, 'PERMANENT')
             if gWizard.georeffile:
-                message = _("Do you want to import <%(name)s> to the newly created location? "
-                            "The location's default region will be set from this imported "
-                            "map.") % {'name': gWizard.georeffile}
+                message = _("Do you want to import <%(name)s> to the newly created location?") % \
+                    {'name': gWizard.georeffile}
                 dlg = wx.MessageDialog(parent = self,
                                        message = message,
                                        caption = _("Import data?"),
@@ -577,11 +576,11 @@
         wx.Yield()
         if mapName in vectors:
             # vector detected
-            returncode, error = RunCommand('v.in.ogr', input = filePath, output = mapName,
-                                           getErrorMsg = True)
+            returncode, error = RunCommand('v.in.ogr', input=filePath, output=mapName, flags='e',
+                                           getErrorMsg=True)
         else:
-            returncode, error = RunCommand('r.in.gdal', input = filePath, output = mapName,
-                                           getErrorMsg = True)
+            returncode, error = RunCommand('r.in.gdal', input=filePath, output=mapName, flags='e',
+                                           getErrorMsg=True)
         wx.EndBusyCursor()
 
         if returncode != 0:
@@ -589,18 +588,10 @@
                    message = _("Import of <%(name)s> failed.\n"
                                "Reason: %(msg)s") % ({'name': filePath, 'msg': error}))
         else:
-            GMessage(message = _("Data file <%(name)s> imported successfully.") % {'name': filePath},
-                     parent = self)
-            if not grass.find_file(element = 'cell', name = mapName)['fullname'] and \
-                    not grass.find_file(element = 'vector', name = mapName)['fullname']:
-                GError(parent = self,
-                       message = _("Map <%s> not found.") % mapName)
-            else:
-                if mapName in vectors:
-                    args = {'vector' : mapName}
-                else:
-                    args = {'raster' : mapName}
-                RunCommand('g.region', flags = 's', parent = self, **args)
+            GMessage(message=_("Data file <%(name)s> imported successfully. "
+                               "The location's default region was set from this imported map.") %
+                               {'name': filePath},
+                     parent=self)
 
     # the event can be refactored out by using lambda in bind
     def RenameMapset(self, event):



More information about the grass-commit mailing list