Переглянути джерело

man: allow for empty lines html file, trac https://trac.osgeo.org/grass/ticket/2187

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58876 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 11 роки тому
батько
коміт
ccd73a7a39
1 змінених файлів з 4 додано та 3 видалено
  1. 4 3
      man/build_keywords.py

+ 4 - 3
man/build_keywords.py

@@ -23,7 +23,9 @@ htmlfiles = glob.glob1(path, '*.html')
 for fname in htmlfiles:
     fil = open(os.path.join(path, fname))
     # TODO maybe move to Python re (regex)
-    lines=fil.readlines()
+    lines = fil.readlines()
+    # remove empty lines
+    lines = [x for x in lines if x != '\n']
     try:
         index_keys = lines.index('<h2>KEYWORDS</h2>\n') + 1
         index_desc = lines.index('<h2>NAME</h2>\n') + 1
@@ -63,6 +65,5 @@ for key, values in sorted(keywords.iteritems()):
     keywordsfile.write(keyword_line)
 
 keywordsfile.write("</dl>\n")
-write_html_footer(keywordsfile, "index.html", year)  
+write_html_footer(keywordsfile, "index.html", year)
 keywordsfile.close()
-