Selaa lähdekoodia

fix url source link on windows (see https://trac.osgeo.org/grass/ticket/3224)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70660 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 vuotta sitten
vanhempi
commit
b783211f7e
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      tools/mkhtml.py

+ 6 - 3
tools/mkhtml.py

@@ -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 @@ if not year:
 # 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 @@ if os.getenv('SOURCE_URL', ''):
             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')))