Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Nov 10, 2015
1 parent b57d5ab commit 9a89408b72f8bee603a2b3ece66b3905cf6fd04a
Showing with 218 additions and 200 deletions.
  1. +1 −1 python/gui/qgsactionmenu.sip
  2. +1 −1 python/gui/qgsadvanceddigitizingcanvasitem.sip
  3. +25 −26 python/plugins/processing/algs/otb/OTBSpecific_XMLLoading.py
  4. +78 −59 python/plugins/processing/algs/otb/maintenance/OTBHelper.py
  5. +15 −21 python/plugins/processing/algs/otb/maintenance/OTBSpecific_XMLcreation.py
  6. +10 −8 python/plugins/processing/algs/qgis/spatialite_utils.py
  7. +3 −3 python/plugins/processing/core/Processing.py
  8. +7 −3 python/plugins/processing/core/parameters.py
  9. +2 −3 python/plugins/processing/gui/ConfigDialog.py
  10. +10 −9 python/plugins/processing/gui/GetScriptsAndModels.py
  11. +4 −6 python/plugins/processing/gui/OutputSelectionPanel.py
  12. +2 −2 python/plugins/processing/gui/PostgisTableSelector.py
  13. +4 −2 python/plugins/processing/modeler/ModelerAlgorithm.py
  14. +1 −2 python/plugins/processing/modeler/ModelerDialog.py
  15. +0 −1 python/plugins/processing/script/ScriptAlgorithm.py
  16. +2 −0 python/plugins/processing/tools/system.py
  17. +7 −7 python/plugins/processing/tools/vector.py
  18. +1 −1 src/app/composer/qgscomposerlegendwidget.h
  19. +7 −7 src/core/qgsvectorlayerfeatureiterator.cpp
  20. +2 −2 src/gui/qgsexpressionbuilderwidget.cpp
  21. +1 −1 src/gui/qgsmapcanvassnapper.cpp
  22. +4 −4 src/gui/symbology-ng/qgssymbolslistwidget.cpp
  23. +11 −11 src/providers/grass/qgsgrassundocommand.cpp
  24. +5 −5 src/server/qgsconfigparserutils.cpp
  25. +1 −1 src/server/qgsconfigparserutils.h
  26. +14 −14 tests/src/python/test_qgsatlascomposition.py
@@ -64,5 +64,5 @@ class QgsActionMenu : QMenu

signals:
void reinit();

};
@@ -1,7 +1,7 @@
/**
* @brief The QgsAdvancedDigitizingCanvasItem class draws the graphical elements of the CAD tools (@see QgsAdvancedDigitizingDock) on the map canvas.
*/

class QgsAdvancedDigitizingCanvasItem : QgsMapCanvasItem
{
%TypeHeaderCode
@@ -39,15 +39,14 @@

try:
import processing
except ImportError, e:
except ImportError as e:
raise Exception("Processing must be installed and available in PYTHONPATH")

from processing.core.ProcessingConfig import ProcessingConfig

from OTBUtils import OTBUtils



def adaptBinaryMorphologicalOperation(commands_list):
val = commands_list[commands_list.index("-filter") + 1]

@@ -105,7 +104,7 @@ def adaptSplitImage(commands_list):
item = item.replace(".file", ".tif")
if item == "-out":
index = commands_list.index(item)
if "." not in os.path.basename(commands_list[index + 1] ):
if "." not in os.path.basename(commands_list[index + 1]):
commands_list[index + 1] = commands_list[index + 1][:-1] + ".tif" + commands_list[index + 1][-1]
commands_list2.append(item)
return commands_list2
@@ -122,12 +121,13 @@ def adaptLSMSVectorization(commands_list):
item = item.replace(".file", ".shp")
if item == "-out":
index = commands_list.index(item)
if "." not in os.path.basename(commands_list[index + 1] ):
if "." not in os.path.basename(commands_list[index + 1]):
commands_list[index + 1] = commands_list[index + 1][:-1] + ".shp" + commands_list[index + 1][-1]
commands_list2.append(item)

return commands_list2


def adaptComputeImagesStatistics(commands_list):
"""
Ran by default, the extension of output file is .file. Replace it with ".xml"
@@ -140,7 +140,7 @@ def adaptComputeImagesStatistics(commands_list):
commands_list2.append(item)
if item == "-out":
index = commands_list.index(item)
if "." not in os.path.basename(commands_list[index + 1] ):
if "." not in os.path.basename(commands_list[index + 1]):
commands_list[index + 1] = commands_list[index + 1][:-1] + ".xml" + commands_list[index + 1][-1]

return commands_list2
@@ -159,7 +159,7 @@ def adaptKmzExport(commands_list):
item = item.replace(".file", ".kmz")
if item == "-out":
index = commands_list.index(item)
if "." not in os.path.basename(commands_list[index + 1] ):
if "." not in os.path.basename(commands_list[index + 1]):
commands_list[index + 1] = commands_list[index + 1][:-1] + ".kmz" + commands_list[index + 1][-1]

commands_list2.append(item)
@@ -171,11 +171,10 @@ def adaptColorMapping(commands_list):
The output of this algorithm must be in uint8.
"""
indexInput = commands_list.index("-out")
commands_list[indexInput+1] = commands_list[indexInput+1] + " uint8"
commands_list[indexInput + 1] = commands_list[indexInput + 1] + " uint8"
return commands_list



def adaptStereoFramework(commands_list):
"""
Remove parameter and user value instead of giving None.
@@ -186,7 +185,7 @@ def adaptStereoFramework(commands_list):
for item in commands_list:
if "None" in item:
index = commands_list2.index(item)
argumentToRemove = commands_list2[index-1]
argumentToRemove = commands_list2[index - 1]
commands_list2.remove(item)
commands_list2.remove(argumentToRemove)
#commands_list2.append(item)
@@ -204,7 +203,7 @@ def adaptComputeConfusionMatrix(commands_list):
item = item.replace(".file", ".csv")
if item == "-out":
index = commands_list.index(item)
if "." not in os.path.basename(commands_list[index + 1] ):
if "." not in os.path.basename(commands_list[index + 1]):
commands_list[index + 1] = commands_list[index + 1][:-1] + ".csv" + commands_list[index + 1][-1]

commands_list2.append(item)
@@ -222,12 +221,12 @@ def adaptRadiometricIndices(commands_list):
"ri" : "Soil:RI", "ci" : "Soil:CI", "bi" : "Soil:BI", "bi2" : "Soil:BI2"}
"""
# "laindvilog" : , "lairefl" : , "laindviformo" : ,
indices = {"ndvi" : "Vegetation:NDVI", "tndvi" : "Vegetation:TNDVI", "rvi" : "Vegetation:RVI", "savi" : "Vegetation:SAVI",
"tsavi" : "Vegetation:TSAVI", "msavi" : "Vegetation:MSAVI", "msavi2" : "Vegetation:MSAVI2", "gemi" : "Vegetation:GEMI",
"ipvi" : "Vegetation:IPVI",
"ndwi" : "Water:NDWI", "ndwi2" : "Water:NDWI2", "mndwi" :"Water:MNDWI" , "ndpi" : "Water:NDPI",
"ndti" : "Water:NDTI",
"ri" : "Soil:RI", "ci" : "Soil:CI", "bi" : "Soil:BI", "bi2" : "Soil:BI2"}
indices = {"ndvi": "Vegetation:NDVI", "tndvi": "Vegetation:TNDVI", "rvi": "Vegetation:RVI", "savi": "Vegetation:SAVI",
"tsavi": "Vegetation:TSAVI", "msavi": "Vegetation:MSAVI", "msavi2": "Vegetation:MSAVI2", "gemi": "Vegetation:GEMI",
"ipvi": "Vegetation:IPVI",
"ndwi": "Water:NDWI", "ndwi2": "Water:NDWI2", "mndwi": "Water:MNDWI", "ndpi": "Water:NDPI",
"ndti": "Water:NDTI",
"ri": "Soil:RI", "ci": "Soil:CI", "bi": "Soil:BI", "bi2": "Soil:BI2"}
for item in commands_list:
if item in indices:
commands_list[commands_list.index(item)] = indices[item]
@@ -251,7 +250,7 @@ def adaptConnectedComponentSegmentation(commands_list):
for item in commands_list:
if "None" in item:
index = commands_list2.index(item)
argumentToRemove = commands_list2[index-1]
argumentToRemove = commands_list2[index - 1]
commands_list2.remove(item)
commands_list2.remove(argumentToRemove)
#commands_list2.append(item)
@@ -289,25 +288,25 @@ def adaptTrainImagesClassifier(commands_list):
adaptGeoidSrtm(commands_list)
return commands_list


def adaptGeoidSrtm(commands_list):
"""
Check geoid file, srtm folder and given elevation and manage arguments.
"""
srtm, geoid = ckeckGeoidSrtmSettings()


if srtm :
if commands_list[0].endswith("ExtractROI") :
if srtm:
if commands_list[0].endswith("ExtractROI"):
commands_list.append("-mode.fit.elev.dem")
commands_list.append(srtm)
else :
else:
commands_list.append("-elev.dem")
commands_list.append(srtm)
if geoid :
if commands_list[0].endswith("ExtractROI") :
if geoid:
if commands_list[0].endswith("ExtractROI"):
commands_list.append("-mode.fit.elev.geoid")
commands_list.append(geoid)
else :
else:
commands_list.append("-elev.geoid")
commands_list.append(geoid)

@@ -349,10 +348,10 @@ def adaptComputeOGRLayersFeaturesStatistics(commands_list):
def ckeckGeoidSrtmSettings():
folder = ProcessingConfig.getSetting(OTBUtils.OTB_SRTM_FOLDER)
if folder is None:
folder =""
folder = ""

filepath = ProcessingConfig.getSetting(OTBUtils.OTB_GEOID_FILE)
if filepath is None:
filepath =""
filepath = ""

return folder, filepath

0 comments on commit 9a89408

Please sign in to comment.
You can’t perform that action at this time.