[GRASS-SVN] r49571 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 6 12:46:43 EST 2011


Author: martinl
Date: 2011-12-06 09:46:43 -0800 (Tue, 06 Dec 2011)
New Revision: 49571

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py
Log:
wxGUI/extension: fix loading extensions without any prefix
		 (merge r49570 from devbr6)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py	2011-12-06 17:43:45 UTC (rev 49570)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py	2011-12-06 17:46:43 UTC (rev 49571)
@@ -1016,7 +1016,8 @@
                  'r3' : 'raster3D',
                  's'  : 'sites',
                  'v'  : 'vector',
-                 'wx' : 'wxGUI' }
+                 'wx' : 'wxGUI',
+                 ''   : 'other' }
         
         if c in name:
             return name[c]
@@ -1055,7 +1056,12 @@
             if full:
                 key, value = line.split('=', 1)
                 if key == 'name':
-                    prefix, name = value.split('.', 1)
+                    try:
+                        prefix, name = value.split('.', 1)
+                    except ValueError:
+                        prefix = ''
+                        name = value
+                    
                     if prefix not in mdict:
                         mdict[prefix] = dict()
                     mdict[prefix][name] = dict()
@@ -1065,11 +1071,11 @@
                 try:
                     prefix, name = line.strip().split('.', 1)
                 except:
-                    prefix = 'unknown'
+                    prefix = ''
                     name = line.strip()
                 
                 if self._expandPrefix(prefix) == prefix:
-                    prefix = 'unknown'
+                    prefix = ''
                     
                 if prefix not in mdict:
                     mdict[prefix] = dict()
@@ -1082,8 +1088,12 @@
             names = mdict[prefix].keys()
             names.sort()
             for name in names:
+                if prefix:
+                    text = prefix + '.' + name
+                else:
+                    text = name
                 new = self.AppendItem(parentId = item,
-                                      text = prefix + '.' + name)
+                                      text = text)
                 data = dict()
                 for key in mdict[prefix][name].keys():
                     data[key] = mdict[prefix][name][key]



More information about the grass-commit mailing list