浏览代码

wxGUI/start up: avoid error message after multiband import when creating location (merge from trunk, https://trac.osgeo.org/grass/changeset/64570,r64597)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@64598 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 年之前
父节点
当前提交
fcbf9a49e4
共有 1 个文件被更改,包括 10 次插入19 次删除
  1. 10 19
      gui/wxpython/gis_set.py

+ 10 - 19
gui/wxpython/gis_set.py

@@ -515,9 +515,8 @@ class GRASSStartup(wx.Frame):
             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 @@ class GRASSStartup(wx.Frame):
         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 @@ class GRASSStartup(wx.Frame):
                    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):