From 430870f2dc7d586888febdb009d90319ceb33e14 Mon Sep 17 00:00:00 2001 From: Victor Poughon <victor.poughon@cnes.fr> Date: Wed, 12 Dec 2018 10:50:24 +0100 Subject: [PATCH] DOC: cookbook compatible with python 3.4 on hulk --- .../Scripts/otbGenerateWrappersRstDoc.py | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py index aa681b25fb..0c34d67312 100755 --- a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py +++ b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py @@ -204,23 +204,22 @@ def rst_parameter_value(app, key): return "string1 string2..." # For all other types it's a simple mapping - values = { - ParameterType_Bool: "bool", - **dict.fromkeys([ParameterType_Int, ParameterType_Radius, ParameterType_RAM], "int"), - ParameterType_Float: "float", - ParameterType_String: "string", - ParameterType_StringList: "string1 string2...", - **dict.fromkeys([ParameterType_InputFilename, ParameterType_OutputFilename], "filename [dtype]"), - **dict.fromkeys([ParameterType_InputImage, ParameterType_ComplexInputImage], "image"), - **dict.fromkeys([ParameterType_OutputImage, ParameterType_ComplexOutputImage], "image [dtype]"), - **dict.fromkeys([ParameterType_InputVectorData, ParameterType_OutputVectorData], "vectorfile"), - ParameterType_Directory: "directory", - ParameterType_Choice: "choice", - ParameterType_InputImageList: "image1 image2...", - ParameterType_InputVectorDataList: "vectorfile1 vectorfile2...", - ParameterType_InputFilenameList: "filename1 filename2...", - **dict.fromkeys([ParameterType_InputProcessXML, ParameterType_OutputProcessXML], "filename.xml"), - } + values = {} + values.update({ParameterType_Bool: "bool"}) + values.update(dict.fromkeys([ParameterType_Int, ParameterType_Radius, ParameterType_RAM], "int")) + values.update({ParameterType_Float: "float"}) + values.update({ParameterType_String: "string"}) + values.update({ParameterType_StringList: "string1 string2..."}) + values.update(dict.fromkeys([ParameterType_InputFilename, ParameterType_OutputFilename], "filename) [dtype]")) + values.update(dict.fromkeys([ParameterType_InputImage, ParameterType_ComplexInputImage], "image")) + values.update(dict.fromkeys([ParameterType_OutputImage, ParameterType_ComplexOutputImage], "image [dtype]")) + values.update(dict.fromkeys([ParameterType_InputVectorData, ParameterType_OutputVectorData], "vectorfile")) + values.update({ParameterType_Directory: "directory"}) + values.update({ParameterType_Choice: "choice"}) + values.update({ParameterType_InputImageList: "image1 image2..."}) + values.update({ParameterType_InputVectorDataList: "vectorfile1 vectorfile2..."}) + values.update({ParameterType_InputFilenameList: "filename1 filename2..."}) + values.update(dict.fromkeys([ParameterType_InputProcessXML, ParameterType_OutputProcessXML], "filename.xml")) if type in values: return values[type] -- GitLab