[GRASS-SVN] r54635 - grass/trunk/man
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 15 03:03:21 PST 2013
Author: martinl
Date: 2013-01-15 03:03:21 -0800 (Tue, 15 Jan 2013)
New Revision: 54635
Modified:
grass/trunk/man/Makefile
grass/trunk/man/build_class.py
grass/trunk/man/build_full_index.py
grass/trunk/man/build_html.py
grass/trunk/man/build_index.py
grass/trunk/man/build_topics.py
Log:
fix build_index scripts: report current year (GRASS_VERSION_DATE)
Modified: grass/trunk/man/Makefile
===================================================================
--- grass/trunk/man/Makefile 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/Makefile 2013-01-15 11:03:21 UTC (rev 54635)
@@ -43,11 +43,11 @@
.PHONY: manpages
define build
-GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_$(1).py $(2)
+GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_$(1).py $(2) $(GRASS_VERSION_DATE)
endef
define build_topics
-GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_topics.py $(HTMLDIR)
+GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_topics.py $(HTMLDIR) $(GRASS_VERSION_DATE)
endef
$(HTMLDIR)/topics.html: $(ALL_HTML)
Modified: grass/trunk/man/build_class.py
===================================================================
--- grass/trunk/man/build_class.py 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/build_class.py 2013-01-15 11:03:21 UTC (rev 54635)
@@ -16,6 +16,9 @@
#for all module groups:
cls = sys.argv[1]
modclass = sys.argv[2]
+year = None
+if len(sys.argv) > 3:
+ year = sys.argv[3]
filename = modclass + ".html"
@@ -37,7 +40,7 @@
desc = desc))
f.write("</table>\n")
-write_html_footer(f, "index.html")
+write_html_footer(f, "index.html", year)
f.close()
replace_file(filename)
Modified: grass/trunk/man/build_full_index.py
===================================================================
--- grass/trunk/man/build_full_index.py 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/build_full_index.py 2013-01-15 11:03:21 UTC (rev 54635)
@@ -9,6 +9,10 @@
from build_html import *
+year = None
+if len(sys.argv) > 1:
+ year = sys.argv[1]
+
os.chdir(html_dir)
classes = []
@@ -49,7 +53,7 @@
desc = desc))
f.write("</table>\n")
-write_html_footer(f, "index.html")
+write_html_footer(f, "index.html", year)
f.close()
replace_file(filename)
Modified: grass/trunk/man/build_html.py
===================================================================
--- grass/trunk/man/build_html.py 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/build_html.py 2013-01-15 11:03:21 UTC (rev 54635)
@@ -7,6 +7,7 @@
import sys
import os
import string
+from datetime import datetime
## TODO: better fix this in include/Make/Html.make, see bug RT #5361
@@ -162,7 +163,7 @@
r"""<br><br>
<hr>
<p><a href="${index_url}">Help Index</a> | <a href="topics.html">Topics Index</a> | <a href="full_index.html">Full Index</a><br>
-© 2003-2012 <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${grass_version} Reference Manual</p>
+© 2003-${year} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${grass_version} Reference Manual</p>
</body>
</html>
""")
@@ -329,9 +330,13 @@
box_color = "#e1ecd0"
f.write(overview_tmpl.substitute(box_color = box_color))
-def write_html_footer(f, index_url):
+def write_html_footer(f, index_url, year = None):
+ if year is None:
+ cur_year = default_year
+ else:
+ cur_year = year
f.write(footer_tmpl.substitute(grass_version = grass_version,
- index_url = index_url))
+ index_url = index_url, year = cur_year))
def get_desc(cmd):
f = open(cmd, 'r')
@@ -369,5 +374,6 @@
grass_version = ver.split().strip()
grass_mmver = '.'.join(ver.split('.')[0:2])
macosx = "darwin" in os.environ['ARCH'].lower()
+default_year = "0000" # str(datetime.now().year)
############################################################################
Modified: grass/trunk/man/build_index.py
===================================================================
--- grass/trunk/man/build_index.py 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/build_index.py 2013-01-15 11:03:21 UTC (rev 54635)
@@ -14,10 +14,12 @@
filename = "index.html"
f = open(filename + ".tmp", 'wb')
+year = None
+if len(sys.argv) > 1:
+ year = sys.argv[1]
+
write_html_header(f, "GRASS GIS %s Reference Manual" % grass_version, True)
write_html_cmd_overview(f)
-write_html_footer(f, "index.html")
-
+write_html_footer(f, "index.html", year)
f.close()
replace_file(filename)
-
Modified: grass/trunk/man/build_topics.py
===================================================================
--- grass/trunk/man/build_topics.py 2013-01-14 23:08:19 UTC (rev 54634)
+++ grass/trunk/man/build_topics.py 2013-01-15 11:03:21 UTC (rev 54635)
@@ -10,8 +10,10 @@
import string
from build_html import *
-
path = sys.argv[1]
+year = None
+if len(sys.argv) > 2:
+ year = sys.argv[2]
keywords = {}
@@ -56,7 +58,7 @@
keyfile.write(desc1_tmpl.substitute(cmd = mod, desc = desc,
basename = mod.replace('.html','')))
keyfile.write("</table>\n")
- write_html_footer(keyfile, "index.html")
+ write_html_footer(keyfile, "index.html", year)
topicsfile.write("</ul>\n")
-write_html_footer(topicsfile, "index.html")
+write_html_footer(topicsfile, "index.html", year)
topicsfile.close()
More information about the grass-commit
mailing list