[GRASS-SVN] r66131 - grass/trunk/man

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 6 12:08:11 PDT 2015


Author: martinl
Date: 2015-09-06 12:08:11 -0700 (Sun, 06 Sep 2015)
New Revision: 66131

Modified:
   grass/trunk/man/build_topics.py
Log:
fix topics: allow uppercase (fix eg. GUI vs. gui topic)

Modified: grass/trunk/man/build_topics.py
===================================================================
--- grass/trunk/man/build_topics.py	2015-09-06 17:54:45 UTC (rev 66130)
+++ grass/trunk/man/build_topics.py	2015-09-06 19:08:11 UTC (rev 66131)
@@ -28,7 +28,7 @@
     except:
         continue
     try:
-        key = lines[index_keys].split(',')[1].strip().capitalize().replace(' ', '_')
+        key = lines[index_keys].split(',')[1].strip().replace(' ', '_')
         key = key.split('>')[1].split('<')[0]
     except:
         continue
@@ -47,8 +47,8 @@
                         "%s Reference Manual: Topics index" % grass_version))
 topicsfile.write(headertopics_tmpl)
 
-for key, values in sorted(keywords.iteritems()):
-    keyfile = open(os.path.join(path, 'topic_%s.html' % key.lower()), 'w')
+for key, values in sorted(keywords.iteritems(), key=lambda s: s[0].lower()):
+    keyfile = open(os.path.join(path, 'topic_%s.html' % key), 'w')
     keyfile.write(header1_tmpl.substitute(title = "GRASS GIS " \
                         "%s Reference Manual: Topic %s" % (grass_version,
                                                     key.replace('_', ' '))))
@@ -60,7 +60,7 @@
                                             basename=mod.replace('.html', '')))
     if num_modules >= min_num_modules_for_topic:
         topicsfile.writelines([moduletopics_tmpl.substitute(
-            key=key.lower(), name=key.replace('_', ' '))])
+            key=key, name=key.replace('_', ' '))])
     keyfile.write("</table>\n")
     # link to the keywords index
     # TODO: the labels in keywords index are with spaces and capitals



More information about the grass-commit mailing list