Skip to content

Commit

Permalink
Improved implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrook authored and m-kuhn committed Jun 15, 2013
1 parent d416555 commit 54956db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doPointDistance.py
Expand Up @@ -128,7 +128,7 @@ def accept(self):
else: matType = "Summary"
if self.chkNearest.isChecked(): nearest = self.spnNearest.value()
else: nearest = 0
outName = ftools_utils.getShapefileName(outPath)
outName = ftools_utils.getShapefileName(outPath,'.csv')
self.outFile.clear()
self.compute(point1, point2, field1, field2, outPath, matType, nearest, self.progressBar)
self.progressBar.setValue(100)
Expand Down
8 changes: 3 additions & 5 deletions python/plugins/fTools/tools/ftools_utils.py
Expand Up @@ -383,12 +383,10 @@ def getShapesByGeometryType( baseDir, inShapes, geomType ):

return outShapes

def getShapefileName( outPath ):
def getShapefileName( outPath, extension='.shp' ):
import os.path
outName=os.path.basename(outPath)
if outName.endswith('.shp'):
outName=outName[:-4]
if outName.endswith('.csv'):
outName=outName[:-4]
if outName.endswith(extension):
outName=outName[:-len(extension)]
return outName

0 comments on commit 54956db

Please sign in to comment.