Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Apr 6, 2014
1 parent e9f43c4 commit a7b5a8a574268fb792d6955c5afcd1e5040be44d
Showing with 198 additions and 197 deletions.
  1. +2 −2 python/plugins/processing/algs/ftools/MeanCoords.py
  2. +10 −10 python/plugins/processing/algs/ftools/SpatialJoin.py
  3. +4 −4 python/plugins/processing/gui/ContextAction.py
  4. +1 −1 python/plugins/processing/gui/CreateNewScriptAction.py
  5. +3 −3 python/plugins/processing/gui/MultipleExternalInputDialog.py
  6. +3 −3 python/plugins/processing/gui/ParametersPanel.py
  7. +23 −23 python/plugins/processing/gui/ProcessingToolbox.py
  8. +1 −1 python/plugins/processing/modeler/CreateNewModelAction.py
  9. +1 −1 python/plugins/processing/modeler/SaveAsPythonScriptAction.py
  10. +1 −1 python/plugins/processing/otb/OTBAlgorithmProvider.py
  11. +16 −16 python/plugins/processing/otb/OTBSpecific_XMLLoading.py
  12. +2 −2 python/plugins/processing/otb/OTBUtils.py
  13. +12 −12 python/plugins/processing/otb/maintenance/OTBHelper.py
  14. +11 −11 python/plugins/processing/otb/maintenance/OTBSpecific_XMLcreation.py
  15. +6 −6 python/plugins/processing/otb/maintenance/OTBTester.py
  16. +1 −1 python/plugins/processing/otb/maintenance/TestOTBAlgorithms.py
  17. +1 −1 python/plugins/processing/parameters/ParameterFactory.py
  18. +1 −1 python/plugins/processing/parameters/ParameterMultipleExternalInput.py
  19. +1 −1 python/plugins/processing/script/ScriptAlgorithm.py
  20. +2 −2 python/plugins/processing/script/scripts/Batch_replace_in_string_via_regex_dictionary.py
  21. +63 −62 src/app/pluginmanager/qgspluginmanager.cpp
  22. +1 −1 src/app/qgisapp.h
  23. +1 −1 src/app/qgsmaptoolcapture.cpp
  24. +1 −1 src/app/qgsmaptoolidentifyaction.cpp
  25. +2 −2 src/core/dxf/qgsdxfpallabeling.cpp
  26. +4 −4 src/core/qgscoordinatetransform.cpp
  27. +1 −1 src/core/qgsmaprenderercache.h
  28. +8 −8 src/core/qgsnetworkaccessmanager.cpp
  29. +1 −1 src/core/qgsvectorlayer.h
  30. +1 −1 src/core/symbology-ng/qgssymbollayerv2utils.cpp
  31. +1 −1 src/gui/qgsextentgroupbox.cpp
  32. +3 −3 src/providers/mssql/qgsmssqlfeatureiterator.h
  33. +5 −5 src/providers/mssql/qgsmssqlprovider.cpp
  34. +2 −2 src/providers/postgres/qgspostgresconn.cpp
  35. +1 −1 src/providers/spatialite/qgsspatialiteconnection.h
  36. +1 −1 tests/src/python/test_qgspallabeling_canvas.py
@@ -66,12 +66,12 @@ def processAlgorithm(self, progress):
uniqueField = self.getParameterValue(self.UID)

print weightField, uniqueField

if weightField is None:
weightIndex = -1
else:
weightIndex = layer.fieldNameIndex(weightField)

if uniqueField is None:
uniqueIndex = -1
else:
@@ -56,7 +56,7 @@ def myself(L):
class SpatialJoin(GeoAlgorithm):
'''
Join by location
Port of the spatial join algorithm from fTools to the Processing Toolbox.
'''

@@ -67,7 +67,7 @@ class SpatialJoin(GeoAlgorithm):
GEOMETRY = "GEOMETRY"
KEEP = "KEEP"
OUTPUT = "OUTPUT"

SUMMARYS = [
'Take attributes of the first located feature',
'Take summary of intersecting features'
@@ -77,7 +77,7 @@ class SpatialJoin(GeoAlgorithm):
'Use geometry from target layer',
'Use geometry from joined layer (multipart if summary)'
]

KEEPS = [
'Only keep matching records',
'Keep all records (including non-matching target records)'
@@ -87,7 +87,7 @@ class SpatialJoin(GeoAlgorithm):
# def getIcon(self):
# return QIcon(os.path.dirname(__file__) + "/icons/join_location.png")
#===========================================================================

def defineCharacteristics(self):
self.name = "Join by location"
self.group = "Vector general tools"
@@ -106,7 +106,7 @@ def processAlgorithm(self, progress):
sumList = self.getParameterValue(self.STATS).upper().replace(' ','').split(',')
use_geom = self.getParameterValue(self.GEOMETRY)
keep = self.getParameterValue(self.KEEP) == 1

input1 = self.getParameterValue(self.INPUT1)
layer1 = dataobjects.getObjectFromUri(input1)
provider1 = layer1.dataProvider()
@@ -116,8 +116,8 @@ def processAlgorithm(self, progress):
layer2 = dataobjects.getObjectFromUri(input2)
provider2 = layer2.dataProvider()
fieldList2 = provider2.fields()
fieldList = QgsFields()

fieldList = QgsFields()
if not summary:
fieldList2 = vector.testForUniqueness(fieldList1, fieldList2)
seq = range(0, len(fieldList1) + len(fieldList2))
@@ -157,12 +157,12 @@ def processAlgorithm(self, progress):
geometry_type = provider2.geometryType()

writer = output.getVectorWriter(fields, geometry_type, crs)

inFeat = QgsFeature()
outFeat = QgsFeature()
inFeatB = QgsFeature()
inGeom = QgsGeometry()

progress.setPercentage(15)
start = 15.00
add = 85.00 / provider1.featureCount()
@@ -240,7 +240,7 @@ def processAlgorithm(self, progress):
writer.addFeature(outFeat)
start = start + add
progress.setPercentage(start)

del writer

def singleToMultiGeom(self, wkbType):
@@ -31,11 +31,11 @@ class ContextAction:
def setData(self, alg, toolbox):
self.alg = alg
self.toolbox = toolbox

def updateToolbox(self):
'''
Updates the list of algorithms and then the toolbox.
It only update the item corresponding to the provider of the algorithm.
Updates the list of algorithms and then the toolbox.
It only update the item corresponding to the provider of the algorithm.
To be called after the action is executed, if needed
'''
'''
self.toolbox.updateProvider(self.alg.provider.getName())
@@ -54,5 +54,5 @@ def execute(self):
dlg = ScriptEditorDialog(ScriptEditorDialog.SCRIPT_R, None)
dlg.show()
dlg.exec_()
if dlg.update:
if dlg.update:
self.toolbox.updateProvider('model')
@@ -92,14 +92,14 @@ def addFile(self):
path = lastfolder
else :
path = QtCore.QDir.currentPath()

filesOpened = QtGui.QFileDialog.getOpenFileNames( None, "Select the file(s) to use", path, "All files (*.*)" )

lastfile = ""
for item in filesOpened:
self.options.append( str(item) )
lastfile=item

self.setTableContent()
folder = os.path.dirname( str( lastfile ) )
settings.setValue("processingFilesLastFolder", folder)
@@ -9,7 +9,7 @@
(C) 2013 by CS Systemes d'information (CS SI)
Email : volayaf at gmail dot com
otb at c-s dot fr (CS SI)
Contributors : Victor Olaya
Contributors : Victor Olaya
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
***************************************************************************
* *
@@ -221,7 +221,7 @@ def getWidgetFromParameter(self, param):
items.append((self.getExtendedLayerName(layer), layer))
# if already set, put first in list
for i,(name,layer) in enumerate(items):
if layer and layer.source() == param.value:
if layer and layer.source() == param.value:
items.insert(0, items.pop(i))
item = InputLayerSelectorPanel(items)
elif isinstance(param, ParameterTable):
@@ -243,7 +243,7 @@ def getWidgetFromParameter(self, param):
items.append((layer.name(), layer))
# if already set, put first in list
for i,(name,layer) in enumerate(items):
if layer and layer.source() == param.value:
if layer and layer.source() == param.value:
items.insert(0, items.pop(i))
item = InputLayerSelectorPanel(items)
elif isinstance(param, ParameterBoolean):
@@ -73,7 +73,7 @@ def __init__(self):
self.searchBox.setPlaceholderText(self.tr('Search...'))

self.fillTree()

def textChanged(self):
text = self.searchBox.text().strip(' ').lower()
self._filterItem(self.algorithmTree.invisibleRootItem(), text)
@@ -82,24 +82,24 @@ def textChanged(self):
else:
self.algorithmTree.collapseAll()
self.algorithmTree.invisibleRootItem().child(0).setExpanded(True)
def _filterItem(self, item, text):

def _filterItem(self, item, text):
if (item.childCount() > 0):
show = False
for i in xrange(item.childCount()):
for i in xrange(item.childCount()):
child = item.child(i)
showChild = self._filterItem(child, text)
show = showChild or show
item.setHidden(not show)
show = showChild or show
item.setHidden(not show)
return show
elif isinstance(item, (TreeAlgorithmItem, TreeActionItem)):
hide = bool(text) and (text not in item.text(0).lower())
item.setHidden(hide)
elif isinstance(item, (TreeAlgorithmItem, TreeActionItem)):
hide = bool(text) and (text not in item.text(0).lower())
item.setHidden(hide)
return not hide
else:
item.setHidden(True)
item.setHidden(True)
return False


def modeHasChanged(self):
idx = self.modeComboBox.currentIndex()
@@ -116,7 +116,7 @@ def modeHasChanged(self):
def updateTree(self):
Processing.updateAlgsList()
self.fillTree()

def updateProvider(self, providerName, updateAlgsList = True):
if updateAlgsList:
Processing.updateAlgsList()
@@ -308,9 +308,9 @@ def fillTreeUsingCategories(self):
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
if not ProcessingConfig.getSetting(name):
continue
providerItem = TreeProviderItem(providerName)
providerItem = TreeProviderItem(providerName)
self.algorithmTree.addTopLevelItem(providerItem)

def fillTreeUsingProviders(self):
self.algorithmTree.clear()
for providerName in Processing.algs.keys():
@@ -320,7 +320,7 @@ def fillTreeUsingProviders(self):
providerItem = TreeProviderItem(providerName)
self.algorithmTree.addTopLevelItem(providerItem)
providerItem.setHidden(providerItem.childCount() == 0)



class TreeAlgorithmItem(QTreeWidgetItem):
@@ -348,20 +348,20 @@ def __init__(self, action):
self.action = action
self.setText(0, action.name)
self.setIcon(0, action.getIcon())

class TreeProviderItem(QTreeWidgetItem):

def __init__(self, providerName):
QTreeWidgetItem.__init__(self)
self.providerName = providerName
self.providerName = providerName
self.provider = Processing.getProviderFromName(providerName)
self.setIcon(0, self.provider.getIcon())
self.populate()

def refresh(self):
self.takeChildren()
self.populate()

def populate(self):
groups = {}
count = 0
@@ -384,21 +384,21 @@ def populate(self):
count += 1

actions = Processing.actions[self.providerName]
for action in actions:
for action in actions:
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0, action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)
groupItem.addChild(algItem)

self.setText(0, self.provider.getDescription()
+ ' [' + str(count) + ' geoalgorithms]')
self.setToolTip(0, self.text(0))
for groupItem in groups.values():
self.addChild(groupItem)



@@ -43,5 +43,5 @@ def execute(self):
dlg = ModelerDialog()
dlg.show()
dlg.exec_()
if dlg.update:
if dlg.update:
self.toolbox.updateProvider('model')
@@ -55,7 +55,7 @@ def execute(self):
fout.write(text)
fout.close()
if filename.replace('\\', '/').startswith(
ScriptUtils.scriptsFolder().replace('\\', '/')):
ScriptUtils.scriptsFolder().replace('\\', '/')):
self.toolbox.updateProvider('script')
except:
QMessageBox.warning(self, self.tr('I/O error'),
@@ -63,7 +63,7 @@ def createAlgsList(self):
if descriptionFile.endswith("xml"):
try:
alg = OTBAlgorithm(os.path.join(folder, descriptionFile))

if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
else:
@@ -8,7 +8,7 @@
Copyright : (C) 2013 by CS Systemes d'information (CS SI)
Email : otb at c-s dot fr (CS SI)
Contributors : Julien Malik (CS SI) - creation of otbspecific
Oscar Picas (CS SI) -
Oscar Picas (CS SI) -
Alexia Mondot (CS SI) - split otbspecific into 2 files
add functions
***************************************************************************
@@ -126,7 +126,7 @@ def adaptLSMSVectorization(commands_list):
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):
@@ -143,7 +143,7 @@ def adaptComputeImagesStatistics(commands_list):
index = commands_list.index(item)
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


@@ -162,7 +162,7 @@ def adaptKmzExport(commands_list):
index = commands_list.index(item)
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)
return commands_list2

@@ -207,27 +207,27 @@ def adaptComputeConfusionMatrix(commands_list):
index = commands_list.index(item)
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)
return commands_list2


def adaptRadiometricIndices(commands_list):
"""
Replace indice nickname by its corresponding entry in the following dictionnary :
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",
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"}
"""
# "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",
# "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"}
for item in commands_list:
if item in indices:

0 comments on commit a7b5a8a

Please sign in to comment.