From a501e2f24c33e032e7b11bf2b43ee8acfad2d6ca Mon Sep 17 00:00:00 2001
From: Victor Poughon <victor.poughon@cnes.fr>
Date: Mon, 10 Dec 2018 18:59:29 +0100
Subject: [PATCH] DOC: fix tag file

---
 .../Cookbook/Scripts/otbGenerateWrappersRstDoc.py  | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
index bd4d2d1e48..cdab55a9c1 100755
--- a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+++ b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
@@ -259,7 +259,7 @@ def detect_abuse(app):
 
     return fake_groups
 
-def rst_parameters(app):
+def render_parameters(app):
     "Render application parameters to rst"
 
     output = ""
@@ -378,14 +378,12 @@ def render_application(appname, allapps):
 
     application_documentation_warnings(app)
 
-    parameters = rst_parameters(app)
-
     output = template_application.format(
         label="app-" + appname,
         heading=rst_section(app.GetName(), '='),
         description=app.GetDescription(),
         longdescription=make_links(app.GetDocLongDescription(), allapps),
-        parameters=parameters,
+        parameters=render_parameters(app),
         examples_cli=render_all_examples_cli(app),
         examples_python=render_all_examples_python(app),
         limitations=render_limitations(app),
@@ -428,15 +426,16 @@ def GenerateRstForApplications(rst_dir):
         tags = GetApplicationTags(appName)
         if not tags or len(tags) == 0:
             raise RuntimeError("No tags for application: " + appName)
-        tag = tags[0].replace(' ', '_')
+        tag = tags[0]
+        tag_ = tag.replace(" ", "_")
 
         # Add it to the index (i.e. https://www.orfeo-toolbox.org/CookBook/Applications.html)
         if not tag in writtenTags:
-            appIndexFile.write('\tApplications/' + tag + '.rst\n')
+            appIndexFile.write('\tApplications/' + tag_ + '.rst\n')
             writtenTags.append(tag)
 
         # Create or update tag index file (e.g. https://www.orfeo-toolbox.org/CookBook/Applications/Feature_Extraction.html)
-        tagFileName = rst_dir + '/Applications/'  + tag + '.rst'
+        tagFileName = rst_dir + '/Applications/'  + tag_ + '.rst'
         if os.path.isfile(tagFileName):
             with open(tagFileName, 'a') as tagFile:
                 tagFile.write("\tapp_" + appName + "\n")
@@ -446,7 +445,6 @@ def GenerateRstForApplications(rst_dir):
                 tagFile.write("\tapp_" + appName + "\n")
 
         # Write application rst
-        #print("Generating " + appName + ".rst" +  " on tag " + tag)
         with open(rst_dir + '/Applications/app_'  + appName + '.rst', 'w') as appFile:
             appFile.write(render_application(appName, appNames))
 
-- 
GitLab