[GRASS-SVN] r70660 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 22 08:13:33 PST 2017


Author: martinl
Date: 2017-02-22 08:13:33 -0800 (Wed, 22 Feb 2017)
New Revision: 70660

Modified:
   grass/trunk/tools/mkhtml.py
Log:
fix url source link on windows (see #3224)

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2017-02-22 11:01:21 UTC (rev 70659)
+++ grass/trunk/tools/mkhtml.py	2017-02-22 16:13:33 UTC (rev 70660)
@@ -7,7 +7,7 @@
 #               Glynn Clements
 #               Martin Landa <landa.martin gmail.com>
 # PURPOSE:      Create HTML manual page snippets
-# COPYRIGHT:    (C) 2007-2014 by Glynn Clements
+# COPYRIGHT:    (C) 2007-2017 by Glynn Clements
 #                and the GRASS Development Team
 #
 #               This program is free software under the GNU General
@@ -314,10 +314,10 @@
 # check the names of scripts to assign the right folder
 topdir = os.path.abspath(os.getenv("MODULE_TOPDIR"))
 curdir = os.path.abspath(os.path.curdir)
-pgmdir = curdir.replace(topdir, '').lstrip('/')
+pgmdir = curdir.replace(topdir, '').lstrip(os.path.sep)
+url_source = ''
 if os.getenv('SOURCE_URL', ''):
     # addons
-    url_source = ''
     for prefix in index_names.keys():
         cwd = os.getcwd()
         idx = cwd.find('{0}{1}.'.format(os.path.sep, prefix))
@@ -331,6 +331,9 @@
             break
 else:
     url_source = urlparse.urljoin(source_url, pgmdir)
+if sys.platform == 'win32':
+    url_source = url_source.replace(os.path.sep, '/')
+
 if index_name:
     sys.stdout.write(sourcecode.substitute(URL_SOURCE=url_source, PGM=pgm,
                                            URL_LOG=url_source.replace('browser',  'log')))



More information about the grass-commit mailing list