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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 7 12:35:44 PST 2012


Author: martinl
Date: 2012-12-07 12:35:43 -0800 (Fri, 07 Dec 2012)
New Revision: 54237

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI/forms: better check for allowed file extension (add always `*.*` mask)


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2012-12-07 20:22:17 UTC (rev 54236)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2012-12-07 20:35:43 UTC (rev 54237)
@@ -1366,11 +1366,14 @@
                     else:
                         fmode = wx.OPEN
                     # check wildcard
-                    fExt = os.path.splitext(p.get('key_desc', ['*.*'])[0])[1]
+                    try:
+                        fExt = os.path.splitext(p.get('key_desc', ['*.*'])[0])[1]
+                    except:
+                        fExt = None
                     if not fExt:
                         fMask = '*.*'
                     else:
-                        fMask = '*' + fExt
+                        fMask = '%s files (*%s)|*%s|Files (*.*)|*.*' % (fExt[1:].upper(), fExt, fExt)
                     fbb = filebrowse.FileBrowseButton(parent = which_panel, id = wx.ID_ANY, fileMask = fMask,
                                                       size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
                                                       dialogTitle = _('Choose %s') % \



More information about the grass-commit mailing list