[GRASS-SVN] r57040 - grass/branches/releasebranch_6_4/gui/wxpython/modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 8 02:55:59 PDT 2013


Author: hamish
Date: 2013-07-08 02:55:59 -0700 (Mon, 08 Jul 2013)
New Revision: 57040

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/modules/ogc_services.py
Log:
catch case where section titles exist before and between any layers, avoid traceback when encountering utf chars (merge from devbr6)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/modules/ogc_services.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/ogc_services.py	2013-07-08 08:54:23 UTC (rev 57039)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/ogc_services.py	2013-07-08 09:55:59 UTC (rev 57040)
@@ -200,15 +200,18 @@
                 layers[value] = {}
                 lastLayer = value
             elif key == 'title':
-                layers[lastLayer][key] = value
+                if lastLayer and 'title' not in layers[lastLayer]:
+                    layers[lastLayer][key] = value.decode('utf8')
             elif key == 'style':
-                if 'style' not in layers[lastLayer]:
-                    layers[lastLayer]['style'] = {}
-                layers[lastLayer]['style'][value] = ''
-                lastStyle = value
+                if lastLayer:
+                    if 'style' not in layers[lastLayer]:
+                        layers[lastLayer]['style'] = {}
+                    layers[lastLayer]['style'][value] = ''
+                    lastStyle = value
             elif key == 'style title':
-                layers[lastLayer]['style'][lastStyle] = value
-        
+                if lastLayer:
+                    layers[lastLayer]['style'][lastStyle] = value
+
         # update list of layers
         self.list.LoadData(layers)
         



More information about the grass-commit mailing list