@@ -241,8 +241,7 @@ def runFinishedFromThread( self, results ):
241
241
out_text = ""
242
242
if results [3 ] is not None :
243
243
QMessageBox .warning ( self , self .tr ( "Geoprocessing" ),
244
- self .tr ( "No output created. File creation error:\n %1" )
245
- .arg ( results [3 ] ) )
244
+ self .tr ( "No output created. File creation error:\n %s" ) % ( results [3 ] ) )
246
245
return
247
246
if (not results [2 ] is None and not results [2 ]) or not results [1 ] or not results [0 ]:
248
247
out_text = self .tr ( "\n Warnings:" )
@@ -259,10 +258,10 @@ def runFinishedFromThread( self, results ):
259
258
out_text = out_text + self .tr ( "\n Feature geometry error: One or more output features ignored due to invalid geometry." )
260
259
if not results [0 ]:
261
260
out_text = out_text + self .tr ( "\n GEOS geoprocessing error: One or more input features have invalid geometry." )
262
- addToTOC = QMessageBox .question ( self , self .tr ("Geoprocessing" ), self .tr ( "Created output shapefile:\n %1 \n %2%3 " ). arg ( unicode ( self .shapefileName ) ). arg ( out_text ). arg ( end_text ), QMessageBox .Yes , QMessageBox .No , QMessageBox .NoButton )
261
+ addToTOC = QMessageBox .question ( self , self .tr ("Geoprocessing" ), self .tr ( "Created output shapefile:\n %s \n %s%s " ) % ( unicode ( self .shapefileName ), out_text , end_text ), QMessageBox .Yes , QMessageBox .No , QMessageBox .NoButton )
263
262
if addToTOC == QMessageBox .Yes :
264
263
if not ftools_utils .addShapeToCanvas ( unicode ( self .shapefileName ) ):
265
- QMessageBox .warning ( self , self .tr ("Geoprocessing" ), self .tr ( "Error loading output shapefile:\n %1 " ). arg ( unicode ( self .shapefileName ) ))
264
+ QMessageBox .warning ( self , self .tr ("Geoprocessing" ), self .tr ( "Error loading output shapefile:\n %s " ) % ( unicode ( self .shapefileName ) ))
266
265
self .populateLayers ()
267
266
268
267
def runStatusFromThread ( self , status ):
@@ -378,7 +377,7 @@ def buffering( self, useField ):
378
377
for inFeat in selectionA :
379
378
atMap = inFeat .attributes ()
380
379
if useField :
381
- value = atMap [ self .myParam ]. toDouble ()[ 0 ]
380
+ value = atMap [ self .myParam ]
382
381
else :
383
382
value = self .myParam
384
383
inGeom = QgsGeometry ( inFeat .geometry () )
@@ -404,11 +403,11 @@ def buffering( self, useField ):
404
403
# with dissolve
405
404
if self .myMerge :
406
405
first = True
407
- fit = vproviderA .getFeatures ()
406
+ fit = vproviderA .getFeatures ()
408
407
while fit .nextFeature ( inFeat ):
409
408
atMap = inFeat .attributes ()
410
409
if useField :
411
- value = atMap [ self .myParam ]. toDouble ()[ 0 ]
410
+ value = atMap [ self .myParam ]
412
411
else :
413
412
value = self .myParam
414
413
inGeom = QgsGeometry ( inFeat .geometry () )
@@ -435,11 +434,11 @@ def buffering( self, useField ):
435
434
FEATURE_EXCEPT = False
436
435
# without dissolve
437
436
else :
438
- fit = vproviderA .getFeatures ()
437
+ fit = vproviderA .getFeatures ()
439
438
while fit .nextFeature ( inFeat ):
440
439
atMap = inFeat .attributes ()
441
440
if useField :
442
- value = atMap [ self .myParam ]. toDouble ()[ 0 ]
441
+ value = atMap [ self .myParam ]
443
442
else :
444
443
value = self .myParam
445
444
inGeom = QgsGeometry ( inFeat .geometry () )
@@ -574,7 +573,7 @@ def convex_hull(self, useField ):
574
573
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), 0 )
575
574
self .emit ( SIGNAL ( "runRange(PyQt_PyObject)" ), ( 0 , nFeat ) )
576
575
hull = []
577
- fitA = vproviderA .getFeatures ()
576
+ fitA = vproviderA .getFeatures ()
578
577
while fitA .nextFeature ( inFeat ):
579
578
inGeom = QgsGeometry ( inFeat .geometry () )
580
579
points = ftools_utils .extractPoints ( inGeom )
@@ -644,7 +643,7 @@ def dissolve( self, useField ):
644
643
nElement += 1
645
644
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), nElement )
646
645
atMap = inFeat .attributes ()
647
- tempItem = unicode (atMap [self .myParam ]. toString (). trimmed () )
646
+ tempItem = unicode (atMap [self .myParam ]). strip ( )
648
647
649
648
if not (tempItem in outFeats ):
650
649
outFeats [tempItem ] = QgsGeometry (inFeat .geometry ())
@@ -699,7 +698,7 @@ def dissolve( self, useField ):
699
698
nElement += 1
700
699
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), nElement )
701
700
atMap = inFeat .attributes ()
702
- tempItem = unicode (atMap [self .myParam ]. toString (). trimmed () )
701
+ tempItem = unicode (atMap [self .myParam ]). strip ( )
703
702
704
703
if not (tempItem in outFeats ):
705
704
outFeats [tempItem ] = QgsGeometry (inFeat .geometry ())
@@ -817,7 +816,7 @@ def difference( self ):
817
816
# we have selection in overlay layer
818
817
if self .mySelectionB :
819
818
selectionB = self .vlayerB .selectedFeaturesIds ()
820
- fitA = vproviderA .getFeatures ()
819
+ fitA = vproviderA .getFeatures ()
821
820
while fitA .nextFeature ( inFeatA ):
822
821
nElement += 1
823
822
add = True
@@ -894,7 +893,7 @@ def intersect( self ):
894
893
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
895
894
longNames = ftools_utils .checkFieldNameLength ( fields )
896
895
if not longNames .isEmpty ():
897
- message = QString ( 'Following field names are longer than 10 characters:\n %1 ' ). arg ( longNames . join ( '\n ' ) )
896
+ message = QString ( 'Following field names are longer than 10 characters:\n %s ' ) % ( '\n ' . join ( longNames ) )
898
897
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
899
898
900
899
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
@@ -993,7 +992,7 @@ def intersect( self ):
993
992
# we have selection in overlay layer
994
993
if self .mySelectionB :
995
994
selectionB = self .vlayerB .selectedFeaturesIds ()
996
- fitA = vproviderA .getFeatures ()
995
+ fitA = vproviderA .getFeatures ()
997
996
while fitA .nextFeature ( inFeatA ):
998
997
nElement += 1
999
998
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), nElement )
@@ -1079,7 +1078,7 @@ def union( self ):
1079
1078
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
1080
1079
longNames = ftools_utils .checkFieldNameLength ( fields )
1081
1080
if not longNames .isEmpty ():
1082
- message = QString ( 'Following field names are longer than 10 characters:\n %1 ' ). arg ( longNames . join ( ' \n ' ) )
1081
+ message = QString ( 'Following field names are longer than 10 characters:\n %s ' ) % ( " \n " . join ( longNames ) )
1083
1082
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
1084
1083
1085
1084
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
@@ -1265,7 +1264,7 @@ def symetrical_difference( self ):
1265
1264
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
1266
1265
longNames = ftools_utils .checkFieldNameLength ( fields )
1267
1266
if not longNames .isEmpty ():
1268
- message = QString ( 'Following field names are longer than 10 characters:\n %1 ' ). arg ( longNames . join ( ' \n ' ) )
1267
+ message = QString ( 'Following field names are longer than 10 characters:\n %s ' ) % ( " \n " . join ( longNames ) )
1269
1268
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
1270
1269
1271
1270
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
0 commit comments