瀏覽代碼

fix topics: allow uppercase (fix eg. GUI vs. gui topic)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66131 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父節點
當前提交
95c5de2584
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      man/build_topics.py

+ 4 - 4
man/build_topics.py

@@ -28,7 +28,7 @@ for fname in htmlfiles:
     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 @@ topicsfile.write(header1_tmpl.substitute(title = "GRASS GIS " \
                         "%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 @@ for key, values in sorted(keywords.iteritems()):
                                             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