[GRASS-SVN] r41963 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 22 03:33:39 EDT 2010
Author: martinl
Date: 2010-04-22 03:33:13 -0400 (Thu, 22 Apr 2010)
New Revision: 41963
Modified:
grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix GetValidLayerName()
(merge r41962 from devbr6)
Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py 2010-04-22 07:22:44 UTC (rev 41962)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py 2010-04-22 07:33:13 UTC (rev 41963)
@@ -164,15 +164,17 @@
retName, mapset = retName.split('@')
else:
mapset = None
-
- for c in retName:
- # c = toascii(c)
-
+
+ cIdx = 0
+ retNameList = list(retName)
+ for c in retNameList:
if not (c >= 'A' and c <= 'Z') and \
not (c >= 'a' and c <= 'z') and \
not (c >= '0' and c <= '9'):
- c = '_'
-
+ retNameList[cIdx] = '_'
+ cIdx += 1
+ retName = ''.join(retNameList)
+
if not (retName[0] >= 'A' and retName[0] <= 'Z') and \
not (retName[0] >= 'a' and retName[0] <= 'z'):
retName = 'x' + retName[1:]
More information about the grass-commit
mailing list