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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 2 04:13:05 EDT 2011


Author: martinl
Date: 2011-06-02 01:13:05 -0700 (Thu, 02 Jun 2011)
New Revision: 46509

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gpyshell.py
Log:
wxGUI/pyshell: fix `ltype` in AddLayer()
	       (merge r46508 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gpyshell.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gpyshell.py	2011-06-02 08:07:36 UTC (rev 46508)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gpyshell.py	2011-06-02 08:13:05 UTC (rev 46509)
@@ -78,19 +78,20 @@
         @param name name of raster/vector map to be added
         @param type map type ('raster', 'vector', 'auto' for autodetection)
         """
+        fname = None
         if ltype == 'raster' or ltype != 'vector':
+            # check for raster
             fname = grass.find_file(name, element = 'cell')['fullname']
             if fname:
                 ltype = 'raster'
                 lcmd = 'd.rast'
-        elif ltype == 'vector' or ltype != 'raster':
+        
+        if not fname and (ltype == 'vector' or ltype != 'raster'):
+            # if not found check for vector
             fname = grass.find_file(name, element = 'vector')['fullname']
             if fname:
                 ltype = 'vector'
                 lcmd = 'd.vect'
-        else:
-            sys.stderr.write(_("Unsupported map type '%s'") % ltype)
-            return
         
         if not fname:
             return _("Raster or vector map <%s> not found") % (name)
@@ -100,9 +101,9 @@
                                             lchecked = True,
                                             lcmd = [lcmd, 'map=%s' % fname])
         if ltype == 'raster':
-            return _('Raster map <%s> added')
+            return _('Raster map <%s> added') % fname
         
-        return _('Vector map <%s> added')
+        return _('Vector map <%s> added') % fname
     
     def OnClear(self, event):
         """!Delete all text from the shell



More information about the grass-commit mailing list