Skip to content
Permalink
Browse files

Replace str() with unicode() and some PEP 8

  • Loading branch information
m-kuhn committed Aug 16, 2015
1 parent 624f16c commit 9fc1b48bf3ff46c2210bdbbc4d9353033da66f6a
Showing with 906 additions and 916 deletions.
  1. +8 −8 python/plugins/GdalTools/tools/GdalTools_utils.py
  2. +3 −3 python/plugins/GdalTools/tools/dialogBase.py
  3. +1 −1 python/plugins/GdalTools/tools/dialogSRS.py
  4. +1 −1 python/plugins/GdalTools/tools/doBuildVRT.py
  5. +6 −6 python/plugins/GdalTools/tools/doClipper.py
  6. +1 −1 python/plugins/GdalTools/tools/doContour.py
  7. +2 −2 python/plugins/GdalTools/tools/doFillNodata.py
  8. +28 −28 python/plugins/GdalTools/tools/doGrid.py
  9. +1 −1 python/plugins/GdalTools/tools/doInfo.py
  10. +6 −6 python/plugins/GdalTools/tools/doMerge.py
  11. +1 −1 python/plugins/GdalTools/tools/doNearBlack.py
  12. +5 −5 python/plugins/GdalTools/tools/doOverview.py
  13. +1 −1 python/plugins/GdalTools/tools/doPctRgb.py
  14. +3 −3 python/plugins/GdalTools/tools/doProximity.py
  15. +1 −1 python/plugins/GdalTools/tools/doRgbPct.py
  16. +1 −1 python/plugins/GdalTools/tools/doSieve.py
  17. +1 −1 python/plugins/GdalTools/tools/doTranslate.py
  18. +3 −3 python/plugins/GdalTools/tools/doWarp.py
  19. +4 −4 python/plugins/GdalTools/tools/extentSelector.py
  20. +5 −5 python/plugins/MetaSearch/dialogs/maindialog.py
  21. +1 −1 python/plugins/db_manager/db_plugins/oracle/connector.py
  22. +6 −6 python/plugins/db_manager/db_plugins/oracle/plugin.py
  23. +2 −2 python/plugins/db_manager/db_plugins/plugin.py
  24. +3 −4 python/plugins/db_manager/db_plugins/postgis/connector.py
  25. +1 −1 python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py
  26. +6 −7 python/plugins/db_manager/dlg_sql_window.py
  27. +1 −1 python/plugins/fTools/tools/doEliminate.py
  28. +2 −2 python/plugins/fTools/tools/doGeometry.py
  29. +3 −3 python/plugins/fTools/tools/doPointDistance.py
  30. +2 −2 python/plugins/fTools/tools/doPointsInPolygon.py
  31. +1 −1 python/plugins/fTools/tools/doRandPoints.py
  32. +3 −3 python/plugins/fTools/tools/doValidate.py
  33. +1 −1 python/plugins/fTools/tools/ftools_utils.py
  34. +1 −1 python/plugins/fTools/tools/voronoi.py
  35. +4 −4 python/plugins/processing/algs/gdal/ClipByExtent.py
  36. +4 −4 python/plugins/processing/algs/gdal/ClipByMask.py
  37. +1 −1 python/plugins/processing/algs/gdal/ColorRelief.py
  38. +1 −2 python/plugins/processing/algs/gdal/aspect.py
  39. +3 −3 python/plugins/processing/algs/gdal/contour.py
  40. +3 −3 python/plugins/processing/algs/gdal/fillnodata.py
  41. +1 −1 python/plugins/processing/algs/gdal/gdal2xyz.py
  42. +2 −2 python/plugins/processing/algs/gdal/gdalcalc.py
  43. +1 −1 python/plugins/processing/algs/gdal/gdaltindex.py
  44. +5 −5 python/plugins/processing/algs/gdal/hillshade.py
  45. +1 −1 python/plugins/processing/algs/gdal/nearblack.py
  46. +2 −2 python/plugins/processing/algs/gdal/pct2rgb.py
  47. +3 −3 python/plugins/processing/algs/gdal/proximity.py
  48. +11 −11 python/plugins/processing/algs/gdal/rasterize.py
  49. +1 −1 python/plugins/processing/algs/gdal/rasterize_over.py
  50. +1 −1 python/plugins/processing/algs/gdal/rgb2pct.py
  51. +1 −1 python/plugins/processing/algs/gdal/roughness.py
  52. +1 −1 python/plugins/processing/algs/gdal/sieve.py
  53. +2 −2 python/plugins/processing/algs/gdal/slope.py
  54. +1 −1 python/plugins/processing/algs/gdal/tpi.py
  55. +12 −12 python/plugins/processing/algs/gdal/translate.py
  56. +1 −1 python/plugins/processing/algs/gdal/tri.py
  57. +9 −9 python/plugins/processing/algs/gdal/warp.py
  58. +17 −18 python/plugins/processing/algs/grass/GrassAlgorithm.py
  59. +1 −1 python/plugins/processing/algs/grass/GrassUtils.py
  60. +9 −9 python/plugins/processing/algs/grass/nviz.py
  61. +19 −21 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  62. +3 −3 python/plugins/processing/algs/grass7/Grass7Utils.py
  63. +9 −9 python/plugins/processing/algs/grass7/nviz7.py
  64. +2 −2 python/plugins/processing/algs/lidar/fusion/ASCII2DTM.py
  65. +4 −4 python/plugins/processing/algs/lidar/fusion/CanopyMaxima.py
  66. +12 −12 python/plugins/processing/algs/lidar/fusion/CanopyModel.py
  67. +7 −7 python/plugins/processing/algs/lidar/fusion/Catalog.py
  68. +2 −2 python/plugins/processing/algs/lidar/fusion/ClipData.py
  69. +4 −4 python/plugins/processing/algs/lidar/fusion/CloudMetrics.py
  70. +3 −3 python/plugins/processing/algs/lidar/fusion/Cover.py
  71. +2 −2 python/plugins/processing/algs/lidar/fusion/FilterData.py
  72. +1 −1 python/plugins/processing/algs/lidar/fusion/FusionAlgorithm.py
  73. +9 −9 python/plugins/processing/algs/lidar/fusion/GridMetrics.py
  74. +14 −14 python/plugins/processing/algs/lidar/fusion/GridSurfaceCreate.py
  75. +1 −1 python/plugins/processing/algs/lidar/fusion/GroundFilter.py
  76. +1 −1 python/plugins/processing/algs/lidar/fusion/PolyClipData.py
  77. +3 −3 python/plugins/processing/algs/lidar/fusion/TinSurfaceCreate.py
  78. +2 −2 python/plugins/processing/algs/lidar/lastools/LAStoolsAlgorithm.py
  79. +5 −5 python/plugins/processing/algs/lidar/lastools/blast2iso.py
  80. +5 −5 python/plugins/processing/algs/lidar/lastools/blast2isoPro.py
  81. +4 −4 python/plugins/processing/algs/lidar/lastools/flightlinesToCHM.py
  82. +2 −2 python/plugins/processing/algs/lidar/lastools/flightlinesToDTMandDSM.py
  83. +9 −9 python/plugins/processing/algs/lidar/lastools/flightlinesToSingleCHMpitFree.py
  84. +2 −2 python/plugins/processing/algs/lidar/lastools/hugeFileClassify.py
  85. +2 −2 python/plugins/processing/algs/lidar/lastools/hugeFileGroundClassify.py
  86. +2 −2 python/plugins/processing/algs/lidar/lastools/hugeFileNormalize.py
  87. +5 −5 python/plugins/processing/algs/lidar/lastools/las2iso.py
  88. +4 −4 python/plugins/processing/algs/lidar/lastools/las2lasPro_project.py
  89. +4 −4 python/plugins/processing/algs/lidar/lastools/las2las_project.py
  90. +1 −1 python/plugins/processing/algs/lidar/lastools/las2shp.py
  91. +1 −1 python/plugins/processing/algs/lidar/lastools/lasboundary.py
  92. +1 −1 python/plugins/processing/algs/lidar/lastools/lasboundaryPro.py
  93. +2 −2 python/plugins/processing/algs/lidar/lastools/lascanopy.py
  94. +2 −2 python/plugins/processing/algs/lidar/lastools/lascanopyPro.py
  95. +1 −1 python/plugins/processing/algs/lidar/lastools/lasclip.py
  96. +1 −1 python/plugins/processing/algs/lidar/lastools/lascontrol.py
  97. +2 −2 python/plugins/processing/algs/lidar/lastools/lasheight.py
  98. +2 −2 python/plugins/processing/algs/lidar/lastools/lasheightPro.py
  99. +3 −3 python/plugins/processing/algs/lidar/lastools/lasinfo.py
  100. +3 −3 python/plugins/processing/algs/lidar/lastools/lasinfoPro.py
  101. +4 −4 python/plugins/processing/algs/lidar/lastools/lasnoise.py
  102. +4 −4 python/plugins/processing/algs/lidar/lastools/lasnoisePro.py
  103. +1 −1 python/plugins/processing/algs/lidar/lastools/lasoverage.py
  104. +1 −1 python/plugins/processing/algs/lidar/lastools/lasoveragePro.py
  105. +1 −1 python/plugins/processing/algs/lidar/lastools/lasoverlap.py
  106. +1 −1 python/plugins/processing/algs/lidar/lastools/lasoverlapPro.py
  107. +1 −1 python/plugins/processing/algs/lidar/lastools/lasquery.py
  108. +2 −2 python/plugins/processing/algs/lidar/lastools/lassplit.py
  109. +2 −2 python/plugins/processing/algs/lidar/lastools/lasthin.py
  110. +2 −2 python/plugins/processing/algs/lidar/lastools/lasthinPro.py
  111. +2 −2 python/plugins/processing/algs/lidar/lastools/lastile.py
  112. +2 −2 python/plugins/processing/algs/lidar/lastools/lastilePro.py
  113. +1 −1 python/plugins/processing/algs/lidar/lastools/lasview.py
  114. +1 −1 python/plugins/processing/algs/lidar/lastools/lasviewPro.py
  115. +1 −1 python/plugins/processing/algs/lidar/lastools/shp2las.py
  116. +4 −4 python/plugins/processing/algs/lidar/lastools/txt2las.py
  117. +4 −4 python/plugins/processing/algs/lidar/lastools/txt2lasPro.py
  118. +14 −14 python/plugins/processing/algs/otb/OTBAlgorithm.py
  119. +1 −1 python/plugins/processing/algs/otb/OTBSpecific_XMLLoading.py
  120. +2 −2 python/plugins/processing/algs/otb/OTBUtils.py
  121. +10 −10 python/plugins/processing/algs/otb/helper/generate_application_descriptors.py
  122. +12 −12 python/plugins/processing/algs/otb/maintenance/OTBHelper.py
  123. +7 −7 python/plugins/processing/algs/otb/maintenance/OTBTester.py
  124. +2 −2 python/plugins/processing/algs/otb/maintenance/parsing.py
  125. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  126. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsStrings.py
  127. +1 −1 python/plugins/processing/algs/qgis/FieldPyculator.py
  128. +1 −1 python/plugins/processing/algs/qgis/HypsometricCurves.py
  129. +1 −1 python/plugins/processing/algs/qgis/ImportIntoPostGIS.py
  130. +1 −1 python/plugins/processing/algs/qgis/MeanCoords.py
  131. +1 −1 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  132. +2 −2 python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py
  133. +1 −1 python/plugins/processing/algs/qgis/PostGISExecuteSQL.py
  134. +1 −1 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  135. +1 −1 python/plugins/processing/algs/qgis/RasterLayerHistogram.py
  136. +1 −1 python/plugins/processing/algs/qgis/RasterLayerStatistics.py
  137. +1 −1 python/plugins/processing/algs/qgis/RegularPoints.py
  138. +1 −1 python/plugins/processing/algs/qgis/Union.py
  139. +1 −1 python/plugins/processing/algs/qgis/UniqueValues.py
  140. +1 −1 python/plugins/processing/algs/qgis/ZonalStatistics.py
  141. +28 −28 python/plugins/processing/algs/qgis/postgis_utils.py
  142. +1 −1 python/plugins/processing/algs/qgis/voronoi.py
  143. +8 −10 python/plugins/processing/algs/r/RAlgorithm.py
  144. +5 −5 python/plugins/processing/algs/saga/SagaAlgorithm212.py
  145. +3 −3 python/plugins/processing/algs/saga/SagaAlgorithm213.py
  146. +1 −1 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
  147. +2 −2 python/plugins/processing/algs/saga/SagaDescriptionCreator.py
  148. +1 −1 python/plugins/processing/algs/saga/versioncheck.py
  149. +3 −3 python/plugins/processing/algs/taudem/TauDEMAlgorithm.py
  150. +1 −1 python/plugins/processing/algs/taudem/TauDEMAlgorithmProvider.py
  151. +4 −4 python/plugins/processing/algs/taudem/TauDEMMultifileAlgorithm.py
  152. +3 −3 python/plugins/processing/algs/taudem/dinfdistdown.py
  153. +3 −3 python/plugins/processing/algs/taudem/dinfdistdown_multi.py
  154. +4 −4 python/plugins/processing/algs/taudem/dinfdistup.py
  155. +4 −4 python/plugins/processing/algs/taudem/dinfdistup_multi.py
  156. +1 −1 python/plugins/processing/algs/taudem/dinftranslimaccum.py
  157. +1 −1 python/plugins/processing/algs/taudem/dinftranslimaccum2.py
  158. +1 −1 python/plugins/processing/algs/taudem/dinftranslimaccum2_multi.py
  159. +1 −1 python/plugins/processing/algs/taudem/dinftranslimaccum_multi.py
  160. +5 −5 python/plugins/processing/algs/taudem/dropanalysis.py
  161. +5 −5 python/plugins/processing/algs/taudem/dropanalysis_multi.py
  162. +1 −1 python/plugins/processing/algs/taudem/gridnet.py
  163. +1 −1 python/plugins/processing/algs/taudem/gridnet_multi.py
  164. +3 −3 python/plugins/processing/algs/taudem/lengtharea.py
  165. +3 −3 python/plugins/processing/algs/taudem/lengtharea_multi.py
  166. +4 −4 python/plugins/processing/algs/taudem/peukerdouglas.py
  167. +4 −4 python/plugins/processing/algs/taudem/peukerdouglas_multi.py
  168. +3 −3 python/plugins/processing/algs/taudem/slopearea.py
  169. +3 −3 python/plugins/processing/algs/taudem/slopearea_multi.py
  170. +3 −3 python/plugins/processing/core/GeoAlgorithm.py
  171. +2 −2 python/plugins/processing/core/ProcessingConfig.py
  172. +2 −2 python/plugins/processing/gui/AlgorithmExecutor.py
  173. +2 −2 python/plugins/processing/gui/BatchOutputSelectionPanel.py
  174. +1 −1 python/plugins/processing/gui/BatchPanel.py
  175. +2 −2 python/plugins/processing/gui/EditRenderingStylesDialog.py
  176. +1 −1 python/plugins/processing/gui/ExtentSelectionPanel.py
  177. +3 −3 python/plugins/processing/gui/NumberInputDialog.py
  178. +2 −2 python/plugins/processing/gui/ParametersPanel.py
  179. +14 −14 python/plugins/processing/gui/TestTools.py
  180. +6 −6 python/plugins/processing/modeler/CalculatorModelerAlgorithm.py
  181. +7 −7 python/plugins/processing/modeler/ModelerAlgorithm.py
  182. +1 −1 python/plugins/processing/modeler/ModelerDialog.py
  183. +6 −6 python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
  184. +5 −5 python/plugins/processing/modeler/ModelerParametersDialog.py
  185. +12 −12 python/plugins/processing/tests/GdalTest.py
  186. +3 −3 python/plugins/processing/tests/GeoAlgorithmTest.py
  187. +15 −15 python/plugins/processing/tests/ModelerAlgorithmTest.py
  188. +170 −170 python/plugins/processing/tests/QgisAlgsTest.py
  189. +3 −3 python/plugins/processing/tests/RunAlgTest.py
  190. +11 −11 python/plugins/processing/tests/SagaTest.py
  191. +8 −8 python/plugins/processing/tests/ScriptTest.py
  192. +2 −2 python/plugins/processing/tools/dataobjects.py
  193. +2 −2 python/plugins/processing/tools/general.py
  194. +1 −1 python/plugins/processing/tools/raster.py
  195. +6 −6 python/plugins/processing/tools/system.py
  196. +2 −2 python/plugins/processing/tools/vector.py
  197. +34 −33 tests/src/python/test_provider_memory.py
  198. +0 −3 tests/src/python/test_qgsrelation.py
@@ -508,7 +508,7 @@ def getFilterName(self, aFilter):

@classmethod
def filenameMatchesFilterExt(self, fileName, ext):
return re.match( '.'+str(ext), fileName ) is not None
return re.match( '.'+unicode(ext), fileName ) is not None

# Retrieves gdal information
class GdalConfig:
@@ -542,7 +542,7 @@ def getSupportedRasters(self):
driver = gdal.GetDriver(i)

if driver is None:
QgsLogger.warning("unable to get driver " + str(i))
QgsLogger.warning("unable to get driver " + unicode(i))
continue

# now we need to see if the driver is for something currently
@@ -557,7 +557,7 @@ def getSupportedRasters(self):

metadata = driver.GetMetadata()
if gdal.DMD_EXTENSION in metadata:
extensions = str(metadata[gdal.DMD_EXTENSION])
extensions = unicode(metadata[gdal.DMD_EXTENSION])

if longName != '':
if extensions != '':
@@ -613,7 +613,7 @@ def getSupportedVectors(self):
driver = ogr.GetDriver(i)

if driver is None:
QgsLogger.warning("unable to get driver " + str(i))
QgsLogger.warning("unable to get driver " + unicode(i))
continue

driverName = driver.GetName()
@@ -802,7 +802,7 @@ def __init__(self, ver):
def string2vers(string):
vers = ['0', '0', '0']

nums = str(string).split(".")
nums = unicode(string).split(".")

if len(nums) > 0:
vers[0] = nums[0]
@@ -842,10 +842,10 @@ def setProcessEnvironment(process):

envval = os.getenv(name)
if envval is None or envval == "":
envval = str(val)
envval = unicode(val)
elif (platform.system() == "Windows" and val.lower() not in envval.lower().split( sep )) or \
(platform.system() != "Windows" and val not in envval.split( sep )):
envval += "%s%s" % (sep, str(val))
envval += "%s%s" % (sep, unicode(val))
else:
envval = None

@@ -870,7 +870,7 @@ def setMacOSXDefaultEnvironment():
qgis_standalone_gdal_path = u"%s/Frameworks/GDAL.framework" % qgis_app

# path to the GDAL framework when installed as external framework
gdal_versionsplit = str(GdalConfig.version()).split('.')
gdal_versionsplit = unicode(GdalConfig.version()).split('.')
gdal_base_path = u"/Library/Frameworks/GDAL.framework/Versions/%s.%s" % (gdal_versionsplit[0], gdal_versionsplit[1])

if os.path.exists( qgis_standalone_gdal_path ): # qgis standalone
@@ -159,7 +159,7 @@ def onRun(self):
self.enableRun(False)
self.setCursor(Qt.WaitCursor)
if not self.commandIsEditable():
#print(self.command+' '+str(self.arguments))
#print(self.command+' '+unicode(self.arguments))
self.process.start(self.command, self.arguments, QIODevice.ReadOnly)
else:
self.process.start(self.textEditCommand.toPlainText(), QIODevice.ReadOnly)
@@ -202,9 +202,9 @@ def onFinished(self, exitCode, status):
return

# show the error message if there's one, otherwise show the process output message
msg = str(self.process.readAllStandardError())
msg = unicode(self.process.readAllStandardError())
if msg == '':
outMessages = str(self.process.readAllStandardOutput()).splitlines()
outMessages = unicode(self.process.readAllStandardOutput()).splitlines()

# make sure to not show the help
for m in outMessages:
@@ -44,7 +44,7 @@ def __init__(self, title, parent=None):
self.connect(buttonBox, SIGNAL("rejected()"), self.reject)

def authid(self):
return str(self.selector.selectedAuthId())
return unicode(self.selector.selectedAuthId())

def proj4string(self):
return self.selector.selectedProj4String()
@@ -137,7 +137,7 @@ def getArguments(self):
arguments.append("-separate")
if self.srcNoDataCheck.isChecked():
arguments.append("-srcnodata")
arguments.append(str(self.srcNoDataSpin.value()))
arguments.append(unicode(self.srcNoDataSpin.value()))
if self.allowProjDiffCheck.isChecked():
arguments.append("-allow_projection_difference")
arguments.append(self.getOutputFileName())
@@ -137,15 +137,15 @@ def getArgsModeExtent(self):
arguments = []
if self.noDataCheck.isChecked():
arguments.append("-a_nodata")
arguments.append( str(self.noDataSpin.value()))
arguments.append( unicode(self.noDataSpin.value()))
if self.extentModeRadio.isChecked() and self.extentSelector.isCoordsValid():
rect = self.extentSelector.getExtent()
if rect is not None:
arguments.append("-projwin")
arguments.append(str(rect.xMinimum()))
arguments.append(str(rect.yMaximum()))
arguments.append(str(rect.xMaximum()))
arguments.append(str(rect.yMinimum()))
arguments.append(unicode(rect.xMinimum()))
arguments.append(unicode(rect.yMaximum()))
arguments.append(unicode(rect.xMaximum()))
arguments.append(unicode(rect.yMinimum()))
if not self.getOutputFileName() == '':
arguments.append("-of")
arguments.append(self.outputFormat)
@@ -158,7 +158,7 @@ def getArgsModeMask(self):
arguments = []
if self.noDataCheck.isChecked():
arguments.append("-dstnodata")
arguments.append(str(self.noDataSpin.value()))
arguments.append(unicode(self.noDataSpin.value()))
if self.maskModeRadio.isChecked():
mask = self.maskSelector.filename()
if not mask == '':
@@ -94,7 +94,7 @@ def getArguments(self):
arguments.append(self.attributeEdit.text())
if True: # XXX in this moment the -i argument is not optional
arguments.append("-i")
arguments.append(str(self.intervalDSpinBox.value()))
arguments.append(unicode(self.intervalDSpinBox.value()))
arguments.append(self.getInputFileName())
arguments.append(self.outSelector.filename())
return arguments
@@ -152,10 +152,10 @@ def getArguments(self):
arguments.append( self.distanceSpin.text())
if self.smoothCheck.isChecked() and self.smoothSpin.value() != 0:
arguments.append( "-si")
arguments.append( str( self.smoothSpin.value() ))
arguments.append( unicode( self.smoothSpin.value() ))
if self.bandCheck.isChecked() and self.bandSpin.value() != 0:
arguments.append( "-b")
arguments.append( str( self.bandSpin.value() ))
arguments.append( unicode( self.bandSpin.value() ))
if self.maskCheck.isChecked() and maskFile:
arguments.append( "-mask")
arguments.append( maskFile)
@@ -130,18 +130,18 @@ def getArguments(self):
rect = self.extentSelector.getExtent()
if rect is not None:
arguments.append( "-txe")
arguments.append( str(rect.xMinimum()))
arguments.append( str(rect.xMaximum()))
arguments.append( unicode(rect.xMinimum()))
arguments.append( unicode(rect.xMaximum()))
arguments.append( "-tye")
arguments.append( str(rect.yMaximum()))
arguments.append( str(rect.yMinimum()))
arguments.append( unicode(rect.yMaximum()))
arguments.append( unicode(rect.yMinimum()))
if self.algorithmCheck.isChecked() and self.algorithmCombo.currentIndex() >= 0:
arguments.append( "-a")
arguments.append( self.algorithmArguments(self.algorithmCombo.currentIndex()))
if self.resizeGroupBox.isChecked():
arguments.append( "-outsize")
arguments.append( str( self.widthSpin.value() ))
arguments.append( str( self.heightSpin.value() ))
arguments.append( unicode( self.widthSpin.value() ))
arguments.append( unicode( self.heightSpin.value() ))
outputFn = self.getOutputFileName()
if outputFn:
arguments.append( "-of")
@@ -164,34 +164,34 @@ def algorithmArguments(self, index):
arguments = []
if algorithm == "invdist":
arguments.append(algorithm)
arguments.append("power=" + str(self.invdistPowerSpin.value()))
arguments.append("smothing=" + str(self.invdistSmothingSpin.value()))
arguments.append("radius1=" + str(self.invdistRadius1Spin.value()))
arguments.append("radius2=" + str(self.invdistRadius2Spin.value()))
arguments.append("angle=" + str(self.invdistAngleSpin.value()))
arguments.append("max_points=" + str(self.invdistMaxPointsSpin.value()))
arguments.append("min_points=" + str(self.invdistMinPointsSpin.value()))
arguments.append("nodata=" + str(self.invdistNoDataSpin.value()))
arguments.append("power=" + unicode(self.invdistPowerSpin.value()))
arguments.append("smothing=" + unicode(self.invdistSmothingSpin.value()))
arguments.append("radius1=" + unicode(self.invdistRadius1Spin.value()))
arguments.append("radius2=" + unicode(self.invdistRadius2Spin.value()))
arguments.append("angle=" + unicode(self.invdistAngleSpin.value()))
arguments.append("max_points=" + unicode(self.invdistMaxPointsSpin.value()))
arguments.append("min_points=" + unicode(self.invdistMinPointsSpin.value()))
arguments.append("nodata=" + unicode(self.invdistNoDataSpin.value()))
elif algorithm == "average":
arguments.append(algorithm)
arguments.append("radius1=" + str(self.averageRadius1Spin.value()))
arguments.append("radius2=" + str(self.averageRadius2Spin.value()))
arguments.append("angle=" + str(self.averageAngleSpin.value()))
arguments.append("min_points=" + str(self.averageMinPointsSpin.value()))
arguments.append("nodata=" + str(self.averageNoDataSpin.value()))
arguments.append("radius1=" + unicode(self.averageRadius1Spin.value()))
arguments.append("radius2=" + unicode(self.averageRadius2Spin.value()))
arguments.append("angle=" + unicode(self.averageAngleSpin.value()))
arguments.append("min_points=" + unicode(self.averageMinPointsSpin.value()))
arguments.append("nodata=" + unicode(self.averageNoDataSpin.value()))
elif algorithm == "nearest":
arguments.append(algorithm)
arguments.append("radius1=" + str(self.nearestRadius1Spin.value()))
arguments.append("radius2=" + str(self.nearestRadius2Spin.value()))
arguments.append("angle=" + str(self.nearestAngleSpin.value()))
arguments.append("nodata=" + str(self.nearestNoDataSpin.value()))
arguments.append("radius1=" + unicode(self.nearestRadius1Spin.value()))
arguments.append("radius2=" + unicode(self.nearestRadius2Spin.value()))
arguments.append("angle=" + unicode(self.nearestAngleSpin.value()))
arguments.append("nodata=" + unicode(self.nearestNoDataSpin.value()))
else:
arguments.append(self.datametrics[self.datametricsCombo.currentIndex()])
arguments.append("radius1=" + str(self.datametricsRadius1Spin.value()))
arguments.append("radius2=" + str(self.datametricsRadius2Spin.value()))
arguments.append("angle=" + str(self.datametricsAngleSpin.value()))
arguments.append("min_points=" + str(self.datametricsMinPointsSpin.value()))
arguments.append("nodata=" + str(self.datametricsNoDataSpin.value()))
arguments.append("radius1=" + unicode(self.datametricsRadius1Spin.value()))
arguments.append("radius2=" + unicode(self.datametricsRadius2Spin.value()))
arguments.append("angle=" + unicode(self.datametricsAngleSpin.value()))
arguments.append("min_points=" + unicode(self.datametricsMinPointsSpin.value()))
arguments.append("nodata=" + unicode(self.datametricsNoDataSpin.value()))
return ':'.join(arguments)

def loadFields(self, vectorFile=''):
@@ -94,7 +94,7 @@ def onLayersChanged(self):

def finished( self ):
self.rasterInfoList.clear()
arr = str(self.base.process.readAllStandardOutput()).strip()
arr = unicode(self.base.process.readAllStandardOutput()).strip()
if platform.system() == "Windows":
#info = QString.fromLocal8Bit( arr ).strip().split( "\r\n" )
# TODO test
@@ -136,16 +136,16 @@ def getArguments(self):
if self.intersectCheck.isChecked():
if self.extent is not None:
arguments.append("-ul_lr")
arguments.append(str( self.extent.xMinimum() ))
arguments.append(str( self.extent.yMaximum() ))
arguments.append(str( self.extent.xMaximum() ))
arguments.append(str( self.extent.yMinimum() ))
arguments.append(unicode( self.extent.xMinimum() ))
arguments.append(unicode( self.extent.yMaximum() ))
arguments.append(unicode( self.extent.xMaximum() ))
arguments.append(unicode( self.extent.yMinimum() ))
if self.noDataCheck.isChecked():
arguments.append("-n")
arguments.append(str(self.noDataSpin.value()))
arguments.append(unicode(self.noDataSpin.value()))
if Utils.GdalConfig.versionNum() >= 1900:
arguments.append("-a_nodata")
arguments.append(str(self.noDataSpin.value()))
arguments.append(unicode(self.noDataSpin.value()))
if self.separateCheck.isChecked():
arguments.append("-separate")
if self.pctCheck.isChecked():
@@ -81,7 +81,7 @@ def getArguments(self):
arguments.append( "-white")
if self.nearCheck.isChecked():
arguments.append( "-near")
arguments.append( str(self.nearSpin.value()))
arguments.append( unicode(self.nearSpin.value()))
arguments.append( "-o")
arguments.append( self.getOutputFileName())
arguments.append( self.getInputFileName())
@@ -122,8 +122,8 @@ def getArguments( self ):
for option in self.mPyramidOptionsWidget.configOptions():
(k,v) = option.split("=")
arguments.append("--config")
arguments.append(str(k))
arguments.append(str(v))
arguments.append(unicode(k))
arguments.append(unicode(v))

if self.cleanCheck.isChecked():
arguments.append("-clean")
@@ -136,7 +136,7 @@ def getArguments( self ):

if len(self.mPyramidOptionsWidget.overviewList()) > 0:
for level in self.mPyramidOptionsWidget.overviewList():
arguments.append(str(level))
arguments.append(unicode(level))

# set creation options filename/layer for validation
if self.init:
@@ -167,7 +167,7 @@ def getBatchArguments(self, inFile, outFile=None):
arguments.extend(["2", "4", "8", "16", "32"])
else:
for level in self.mPyramidOptionsWidget.overviewList():
arguments.append(str(level))
arguments.append(unicode(level))
return arguments

def isBatchEnabled(self):
@@ -179,7 +179,7 @@ def onFinished(self, exitCode, status):
BasePluginWidget.onFinished(self, exitCode, status)
return

msg = str( self.base.process.readAllStandardError() )
msg = unicode( self.base.process.readAllStandardError() )
if msg != '':
self.errors.append( ">> " + self.inFiles[self.batchIndex] + "<br>" + msg.replace( "\n", "<br>" ) )

@@ -129,7 +129,7 @@ def getArguments(self):
arguments = []
if self.bandCheck.isChecked():
arguments.append( "-b")
arguments.append( str( self.bandSpin.value() ))
arguments.append( unicode( self.bandSpin.value() ))
if self.isBatchEnabled():
return arguments

@@ -92,13 +92,13 @@ def getArguments(self):
arguments.append( self.distUnitsCombo.currentText())
if self.maxDistCheck.isChecked():
arguments.append( "-maxdist")
arguments.append( str(self.maxDistSpin.value()))
arguments.append( unicode(self.maxDistSpin.value()))
if self.noDataCheck.isChecked():
arguments.append( "-nodata")
arguments.append( str(self.noDataSpin.value()))
arguments.append( unicode(self.noDataSpin.value()))
if self.fixedBufValCheck.isChecked():
arguments.append( "-fixed-buf-val")
arguments.append( str(self.fixedBufValSpin.value()))
arguments.append( unicode(self.fixedBufValSpin.value()))
if outputFn:
arguments.append( "-of")
arguments.append( self.outputFormat)
@@ -126,7 +126,7 @@ def getArguments(self):
arguments = []
if self.colorsCheck.isChecked():
arguments.append( "-n")
arguments.append( str( self.colorsSpin.value() ))
arguments.append( unicode( self.colorsSpin.value() ))
if self.isBatchEnabled():
return arguments

@@ -78,7 +78,7 @@ def getArguments(self):
arguments = []
if self.thresholdCheck.isChecked():
arguments.append( "-st")
arguments.append( str(self.thresholdSpin.value()))
arguments.append( unicode(self.thresholdSpin.value()))
if self.connectionsCheck.isChecked() and self.connectionsCombo.currentIndex() >= 0:
arguments.append( "-" + self.connectionsCombo.currentText())
outputFn = self.getOutputFileName()
@@ -198,7 +198,7 @@ def getArguments(self):
arguments.append( self.expand_method[self.expandCombo.currentIndex()])
if self.nodataCheck.isChecked():
arguments.append( "-a_nodata")
arguments.append( str(self.nodataSpin.value()))
arguments.append( unicode(self.nodataSpin.value()))
if self.sdsCheck.isChecked():
arguments.append( "-sds")
if self.srcwinCheck.isChecked() and self.srcwinEdit.text():
@@ -196,11 +196,11 @@ def getArguments(self):
arguments.append(self.resampling_method[self.resamplingCombo.currentIndex()])
if self.cacheCheck.isChecked():
arguments.append("-wm")
arguments.append(str(self.cacheSpin.value()))
arguments.append(unicode(self.cacheSpin.value()))
if self.resizeGroupBox.isChecked():
arguments.append("-ts")
arguments.append(str( self.widthSpin.value() ))
arguments.append(str( self.heightSpin.value() ))
arguments.append(unicode( self.widthSpin.value() ))
arguments.append(unicode( self.heightSpin.value() ))
if self.multithreadCheck.isChecked():
arguments.append("-multi")
if self.noDataCheck.isChecked():

0 comments on commit 9fc1b48

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