Skip to content

Commit e3608db

Browse files
committedJun 16, 2013
[ftools] More SIP API updates
1 parent c7a5e0f commit e3608db

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed
 

‎python/plugins/fTools/tools/doGeoprocessing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ def intersect( self ):
892892
crs_match = crsA == crsB
893893
fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
894894
longNames = ftools_utils.checkFieldNameLength( fields )
895-
if not longNames.isEmpty():
895+
if longNames:
896896
message = self.tr('Following field names are longer than 10 characters:\n%s') % ( '\n'.join(longNames) )
897897
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message
898898

@@ -1077,7 +1077,7 @@ def union( self ):
10771077

10781078
fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
10791079
longNames = ftools_utils.checkFieldNameLength( fields )
1080-
if not longNames.isEmpty():
1080+
if longNames:
10811081
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
10821082
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message
10831083

@@ -1263,7 +1263,7 @@ def symetrical_difference( self ):
12631263

12641264
fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
12651265
longNames = ftools_utils.checkFieldNameLength( fields )
1266-
if not longNames.isEmpty():
1266+
if longNames:
12671267
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
12681268
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message
12691269

‎python/plugins/fTools/tools/doMergeShapes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def inputDir( self ):
5353
self.tr( "Select directory with shapefiles to merge" ),
5454
lastDir )
5555

56-
if inDir.isEmpty():
56+
if not inDir:
5757
return
5858

5959
workDir = QDir( inDir )
@@ -89,8 +89,8 @@ def inputFile( self ):
8989
fileName = QFileInfo( f ).fileName()
9090
self.inputFiles.append( fileName )
9191

92-
self.progressFiles.setRange( 0, self.inputFiles.count() )
93-
self.leInputDir.setText( files.join( ";" ) )
92+
self.progressFiles.setRange( 0, len( self.inputFiles ) )
93+
self.leInputDir.setText( ";".join( files ) )
9494

9595
def changeMode( self ):
9696
if self.chkListMode.isChecked():

‎python/plugins/fTools/tools/doPointDistance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def saveFile(self):
143143
fileCheck = QFile(outName)
144144
filePath = QFileInfo(outName).absoluteFilePath()
145145
if filePath.right(4) != ".csv": filePath = filePath + ".csv"
146-
if not outName.isEmpty():
146+
if outName:
147147
self.outFile.insert(filePath)
148148

149149
def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progressBar):

‎python/plugins/fTools/tools/doSpatialIndex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def processFinished( self, errors ):
133133
self.stopProcessing()
134134
self.restoreGui()
135135

136-
if not errors.isEmpty():
136+
if errors:
137137
msg = self.tr( "Processing of the following layers/files ended with error:<br><br>" ) + "<br>".join(errors)
138138
QErrorMessage( self ).showMessage( msg )
139139

‎python/plugins/fTools/tools/doValidate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def keyPressEvent( self, e ):
115115
for row in range( self.tblUnique.rowCount() ):
116116
items.append( self.tblUnique.item( row, 0 ).text()
117117
+ "," + self.tblUnique.item( row, 1 ).text() + "\n" )
118-
if not items.isEmpty():
118+
if items:
119119
clip_board = QApplication.clipboard()
120120
clip_board.setText( items )
121121
else:

‎python/plugins/fTools/tools/doVectorSplit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def processFinished(self, errors):
123123
outPath = self.outShape.text()
124124
self.restoreGui()
125125

126-
if not errors.isEmpty():
126+
if errors:
127127
msg = self.tr( "Processing of the following layers/files ended with error:<br><br>" ) + "<br>".join(errors)
128128
QErrorMessage( self ).showMessage( msg )
129129

‎python/plugins/fTools/tools/doVisual.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def keyPressEvent( self, e ):
7272
else:
7373
for rec in range( self.tblUnique.rowCount() ):
7474
items.append( self.tblUnique.item( rec, 0 ).text() + ":" + self.tblUnique.item( rec, 1 ).text() + "\n" )
75-
if not items.isEmpty():
75+
if items:
7676
clip_board = QApplication.clipboard()
7777
clip_board.setText( items )
7878
else:

0 commit comments

Comments
 (0)
Please sign in to comment.