[GRASS-SVN] r59786 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 18 10:21:12 PDT 2014


Author: martinl
Date: 2014-04-18 10:21:12 -0700 (Fri, 18 Apr 2014)
New Revision: 59786

Modified:
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: import dialog - fix extension list for vectors
       define default formats: GeoTIFF and Shapefile


Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2014-04-18 15:34:04 UTC (rev 59785)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2014-04-18 17:21:12 UTC (rev 59786)
@@ -1350,15 +1350,23 @@
             fType = 'gdal'
 
         # file
-        fileMask = '%(all)s (*.*)|*.*|' % {'all': _('All files')}
-        for name, ext in sorted(rasterFormatExtension.items()):
+        if not ogr:
+            extList = rasterFormatExtension
+            fileMask = '%(name)s (*.%(low)s;*.%(up)s)|*.%(low)s;*.%(up)s|' % {'name': 'GeoTIFF', 'low': 'tif', 'up': 'TIF'}
+        else:
+            extList = vectorFormatExtension
+            fileMask = '%(name)s (*.%(low)s;*.%(up)s)|*.%(low)s;*.%(up)s|' % {'name': 'ESRI Shapefile', 'low': 'shp', 'up': 'SHP'}
+        for name, ext in sorted(extList.items()):
+            if name in ('ESRI Shapefile', 'GeoTIFF'):
+                continue
             fileMask += '%(name)s (*.%(low)s;*.%(up)s)|*.%(low)s;*.%(up)s|' % {'name': name,
                                                                                'low': ext.lower(),
                                                                                'up': ext.upper()}
         fileMask += '%s (*.zip;*.ZIP)|*.zip;*.ZIP|' % _('ZIP files')
         fileMask += '%s (*.gz;*.GZ)|*.gz;*.GZ|' % _('GZIP files')
         fileMask += '%s (*.tar;*.TAR)|*.tar;*.TAR|' % _('TAR files')
-        fileMask += '%s (*.tar.gz;*.TAR.GZ;*.tgz;*.TGZ)|*.tar.gz;*.TAR.GZ;*.tgz;*.TGZ' % _('TARGZ files')
+        fileMask += '%s (*.tar.gz;*.TAR.GZ;*.tgz;*.TGZ)|*.tar.gz;*.TAR.GZ;*.tgz;*.TGZ|' % _('TARGZ files')
+        fileMask += '%(all)s (*.*)|*.*|' % {'all': _('All files')}
         # only contains formats with extensions hardcoded    
 
         self.filePanel = wx.Panel(parent=self)



More information about the grass-commit mailing list