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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 2 04:07:36 EDT 2011


Author: martinl
Date: 2011-06-02 01:07:36 -0700 (Thu, 02 Jun 2011)
New Revision: 46508

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


Modified: grass/trunk/gui/wxpython/gui_modules/gpyshell.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gpyshell.py	2011-06-02 07:21:06 UTC (rev 46507)
+++ grass/trunk/gui/wxpython/gui_modules/gpyshell.py	2011-06-02 08:07:36 UTC (rev 46508)
@@ -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