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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 4 00:49:52 PST 2014


Author: lucadelu
Date: 2014-02-04 00:49:51 -0800 (Tue, 04 Feb 2014)
New Revision: 58876

Modified:
   grass/trunk/man/build_keywords.py
Log:
man: allow for empty lines html file, trac #2187

Modified: grass/trunk/man/build_keywords.py
===================================================================
--- grass/trunk/man/build_keywords.py	2014-02-04 08:12:25 UTC (rev 58875)
+++ grass/trunk/man/build_keywords.py	2014-02-04 08:49:51 UTC (rev 58876)
@@ -23,7 +23,9 @@
 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 @@
     keywordsfile.write(keyword_line)
 
 keywordsfile.write("</dl>\n")
-write_html_footer(keywordsfile, "index.html", year)  
+write_html_footer(keywordsfile, "index.html", year)
 keywordsfile.close()
-    



More information about the grass-commit mailing list